Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .bumpversion.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ ignore_missing_version = false
ignore_missing_files = false
tag = false
sign_tags = false
tag_name = "v{new_version}"
tag_message = "Bump version: {current_version} → {new_version}"
# tag_name = "v{new_version}"
# tag_message = "Bump version: {current_version} → {new_version}"
allow_dirty = false
commit = false
message = "Bump version: {current_version} → {new_version}"
moveable_tags = []
commit_args = ""
setup_hooks = []
pre_commit_hooks = []
post_commit_hooks = []
# moveable_tags = []
# commit_args = ""
# setup_hooks = []
# pre_commit_hooks = []
# post_commit_hooks = []

[[tool.bumpversion.files]]
filename = "pyproject.toml"
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/bump-version-by-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ jobs:
pull-requests: write

steps:
- uses: actions/checkout@v4
with:
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
with:
with:
ref: ${{ github.event.pull_request.base.ref }}

Copilot uses AI. Check for mistakes.
fetch-depth: 0

- name: Bump Version
id: bump-version
uses: conjikidow/bump-version@v2.0.0
Expand All @@ -23,6 +27,12 @@ jobs:
label-patch: 'Patch'
create-release: 'false'

- 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 }}

Comment on lines +30 to +35
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Suggested change
- 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 }}

Copilot uses AI. Check for mistakes.
Comment on lines +30 to +35
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
- name: Debug outputs
run: |
echo "version-bumped=${{ steps.bump-version.outputs.version-bumped }}"
Expand Down