Scope version-bump workflow to PRs targeting develop
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -2,14 +2,14 @@ name: Version Bump
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [master]
|
||||
branches: [develop]
|
||||
types: [opened, synchronize, reopened, labeled, unlabeled, closed]
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
# Register this job's name as a required status check on master's branch
|
||||
# Register this job's name as a required status check on develop's branch
|
||||
# protection - that's what actually blocks the merge button.
|
||||
check-bump-label:
|
||||
if: github.event.action != 'closed'
|
||||
@@ -20,19 +20,19 @@ jobs:
|
||||
LABELS: ${{ toJson(github.event.pull_request.labels.*.name) }}
|
||||
run: |
|
||||
echo "$LABELS" | grep -qE '"bump/(major|minor|patch|skip)"' || {
|
||||
echo "::error::PR into master must carry one of bump/major, bump/minor, bump/patch, bump/skip"
|
||||
echo "::error::PR into develop must carry one of bump/major, bump/minor, bump/patch, bump/skip"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Runs once, after the merge has already happened, to commit the actual
|
||||
# version bump onto master.
|
||||
# version bump onto develop.
|
||||
apply-version-bump:
|
||||
if: github.event.pull_request.merged == true
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
ref: master
|
||||
ref: develop
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Determine bump level from PR labels
|
||||
@@ -46,7 +46,7 @@ jobs:
|
||||
exit 0
|
||||
fi
|
||||
done
|
||||
echo "::error::merged PR into master has no bump/major, bump/minor, bump/patch, or bump/skip label"
|
||||
echo "::error::merged PR into develop has no bump/major, bump/minor, bump/patch, or bump/skip label"
|
||||
exit 1
|
||||
|
||||
- name: Bump CMakeLists.txt and flake.nix
|
||||
@@ -88,4 +88,4 @@ jobs:
|
||||
git config user.email "actions@noreply.localhost"
|
||||
git add CMakeLists.txt flake.nix
|
||||
git commit -m "Bump version to ${NEW_VERSION}"
|
||||
git push origin HEAD:master
|
||||
git push origin HEAD:develop
|
||||
|
||||
Reference in New Issue
Block a user