Skip to content
Merged
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
19 changes: 12 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
name: Release — Version Bump & Publish

# Runs on every direct push to main (human or PR merge).
# Bot-authored commits are skipped to prevent infinite loops.
# Manually triggered release workflow (via "Run workflow" in GitHub Actions).
# Use the `branch` input to select the source branch for the release (defaults to `main`).
on:
push:
branches: [main]
workflow_dispatch:
inputs:
branch:
description: 'Default Branch Name'
required: true
default: 'main'
Comment on lines +6 to +11
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

workflow_dispatch adds a required branch input, but it isn’t used anywhere (e.g., actions/checkout still uses the default ref). As-is, the input has no effect and may confuse users. Also, switching from push to workflow_dispatch changes the event payload; later job conditions reference github.event.head_commit.message, which is absent for workflow_dispatch and can cause the job if: expression to behave unexpectedly/fail. Consider (a) using inputs.branch in checkout (ref:) and/or PR base, and (b) guarding the head_commit-based skip logic to only run on push events (or default missing messages to an empty string).

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@copilot apply changes based on this feedback

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Applied both fixes in df3f986:

  1. inputs.branch wired into checkout — added ref: ${{ inputs.branch }} so the workflow actually checks out the branch the user specifies when triggering manually.
  2. head_commit.message guarded with || '' — each reference to github.event.head_commit.message in the job if: condition now falls back to an empty string when the field is absent (as it is for workflow_dispatch), so the skip-loop guards evaluate correctly without failing.


permissions:
contents: write # needed to push the release branch and create tags
Expand All @@ -22,16 +26,17 @@ jobs:
# references the release/vX.Y.Z branch name.
if: >-
github.actor != 'github-actions[bot]' &&
!contains(github.event.head_commit.message, '[skip ci]') &&
!(startsWith(github.event.head_commit.message, 'Merge pull request') &&
contains(github.event.head_commit.message, 'release/v'))
!contains(github.event.head_commit.message || '', '[skip ci]') &&
!(startsWith(github.event.head_commit.message || '', 'Merge pull request') &&
contains(github.event.head_commit.message || '', 'release/v'))

steps:
- name: Checkout repository (full history for tagging)
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
ref: ${{ inputs.branch }}

- name: Set up Python
uses: actions/setup-python@v5
Expand Down
Loading