-
Notifications
You must be signed in to change notification settings - Fork 0
ci: add workflow_dispatch release trigger #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,13 @@ on: | |
| push: | ||
| tags: | ||
| - "v*" | ||
| workflow_dispatch: | ||
| inputs: | ||
| bump: | ||
| description: "Version bump" | ||
| type: choice | ||
| options: [patch, minor, major] | ||
| default: patch | ||
|
|
||
| permissions: | ||
| contents: write | ||
|
|
@@ -19,6 +26,27 @@ jobs: | |
| - uses: actions/checkout@v6 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Bump and push tag | ||
| if: github.event_name == 'workflow_dispatch' | ||
| run: | | ||
| set -euo pipefail | ||
| if [ "${GITHUB_REF}" != "refs/heads/master" ]; then | ||
| echo "workflow_dispatch must run from master (got ${GITHUB_REF})" >&2 | ||
| exit 1 | ||
| fi | ||
| git fetch --tags | ||
| latest=$(git tag --list 'v*' --sort=-v:refname | head -n1) | ||
| latest=${latest:-v0.0.0} | ||
| IFS='.' read -r major minor patch <<< "${latest#v}" | ||
| case "${{ inputs.bump }}" in | ||
| major) major=$((major+1)); minor=0; patch=0 ;; | ||
| minor) minor=$((minor+1)); patch=0 ;; | ||
| patch) patch=$((patch+1)) ;; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tag parsing includes prereleasesMedium Severity
Reviewed by Cursor Bugbot for commit eae184a. Configure here. |
||
| esac | ||
| next="v${major}.${minor}.${patch}" | ||
| echo "Bumping ${latest} -> ${next}" | ||
| git tag "${next}" | ||
| git push origin "${next}" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reruns skip failed release tagMedium Severity The Triggered by team rule: abizer-code-review Reviewed by Cursor Bugbot for commit eae184a. Configure here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Release dispatches can raceMedium Severity
Reviewed by Cursor Bugbot for commit eae184a. Configure here. |
||
| - uses: actions/setup-go@v6 | ||
| with: | ||
| go-version: "1.25" | ||
|
|
||


There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Branch guard runs too late
Medium Severity
workflow_dispatchon a non-masterref still reaches the reusabletestjob before this guard runs. Because the workflow grantscontents: write, branch code can execute under a write-scoped checkout token even though dispatch releases are meant to bemaster-only.Additional Locations (2)
.github/workflows/release.yml#L18-L20.github/workflows/release.yml#L14-L16Triggered by team rule: abizer-code-review
Reviewed by Cursor Bugbot for commit eae184a. Configure here.