Conversation
There was a problem hiding this comment.
Pull request overview
Updates the repository’s automated version bump workflow to properly operate on the repo contents and attempts to streamline follow-up automation after a version bump.
Changes:
- Add a full-history checkout step to the
bump-version-by-labelsGitHub Actions workflow. - Add an auto-merge step gated on the bump action’s
version-bumpedoutput. - Comment out several unused
.bumpversion.tomlkeys.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| .github/workflows/bump-version-by-labels.yml | Adds checkout + attempts an auto-merge action after version bumping. |
| .bumpversion.toml | Comments out optional/unused bumpversion configuration entries. |
| - name: Auto-merge pull request | ||
| if: steps.bump-version.outputs.version-bumped == 'true' | ||
| run: gh pr merge --squash --auto "${{ github.event.pull_request.number }}" | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
There was a problem hiding this comment.
gh pr merge is being invoked for github.event.pull_request.number, but this workflow only runs when the PR is already merged (pull_request: closed + merged == true). That means this step will try to merge an already-merged PR and will fail/no-op. If the intent is to merge a version-bump PR created by the bump step, use that PR number/output instead; otherwise remove this step or move the workflow to run before merge (e.g., on label/ready_for_review events).
| - name: Auto-merge pull request | |
| if: steps.bump-version.outputs.version-bumped == 'true' | |
| run: gh pr merge --squash --auto "${{ github.event.pull_request.number }}" | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: |
There was a problem hiding this comment.
On pull_request events, actions/checkout defaults to checking out the PR ref at github.sha (often a detached HEAD). If the version bump is intended to land on the base branch (master) after merge, this checkout should explicitly target the base branch/ref (or this workflow should be triggered by push to master) so the bump action commits to the correct branch.
| with: | |
| with: | |
| ref: ${{ github.event.pull_request.base.ref }} |
| - name: Auto-merge pull request | ||
| if: steps.bump-version.outputs.version-bumped == 'true' | ||
| run: gh pr merge --squash --auto "${{ github.event.pull_request.number }}" | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
There was a problem hiding this comment.
This job uses secrets.GITHUB_TOKEN to push/merge. For PRs coming from forks (the repo docs encourage forking), pull_request workflows run with a read-only token and no secrets, so the bump and merge steps will not be able to write back to the repo. Consider triggering this workflow on push to master (post-merge) or using a workflow_run/deployment-style workflow with appropriate permissions, rather than relying on pull_request context.
No description provided.