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
13 changes: 13 additions & 0 deletions .github/workflows/pypi_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0 # better gh release --generate-notes
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

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

The inline comment is slightly inaccurate: the option is used with gh release create --generate-notes (not gh release --generate-notes). Updating the comment will avoid confusion when someone searches the CLI docs.

Suggested change
fetch-depth: 0 # better gh release --generate-notes
fetch-depth: 0 # better gh release create --generate-notes

Copilot uses AI. Check for mistakes.

- name: Install uv
uses: astral-sh/setup-uv@v8.0.0
Expand Down Expand Up @@ -69,3 +71,14 @@ jobs:
run: |
git tag "v${{ steps.version.outputs.version }}"
git push origin "v${{ steps.version.outputs.version }}"

- name: Create GitHub Release
if: steps.version.outputs.publish == 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
VERSION="${{ steps.version.outputs.version }}"
gh release create "v${VERSION}" \
--title "v${VERSION}" \
--generate-notes \
--verify-tag
Comment on lines +81 to +84
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

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

gh release create will fail (non-zero exit) if the release for this tag already exists, which makes workflow re-runs for an already-published version fail. Consider making this step idempotent by checking for an existing release (e.g., gh release view v$VERSION) and skipping or updating it instead of always creating a new one.

Suggested change
gh release create "v${VERSION}" \
--title "v${VERSION}" \
--generate-notes \
--verify-tag
if gh release view "v${VERSION}" >/dev/null 2>&1; then
echo "GitHub release v${VERSION} already exists; skipping creation."
else
gh release create "v${VERSION}" \
--title "v${VERSION}" \
--generate-notes \
--verify-tag
fi

Copilot uses AI. Check for mistakes.