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
13 changes: 9 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -561,8 +561,10 @@ jobs:
git add CHANGELOG.md
git commit -m "docs: update changelog for v${VERSION}"

# Re-runs of the same tag reuse the branch; overwrite it instead of failing.
git push --force origin "$BRANCH"
# Re-runs of the same tag reuse the branch; overwrite it instead of
# failing, but keep --force-with-lease so a foreign commit that landed
# on the branch is not silently discarded.
git push --force-with-lease origin "$BRANCH"

if [ -n "$(gh pr list --head "$BRANCH" --state open --json number --jq '.[].number')" ]; then
echo "✅ Pull request for $BRANCH already open, updated with latest changelog"
Expand Down Expand Up @@ -597,8 +599,7 @@ jobs:
echo "🔍 Validating release completion for $TAG"

# Check GitHub release
# -R is required: this job has no checkout, so gh cannot infer the repo.
if gh release view "$TAG" -R "${{ github.repository }}" >/dev/null 2>&1; then
if gh release view "$TAG" >/dev/null 2>&1; then
echo "✅ GitHub release exists"
else
echo "❌ GitHub release missing"
Expand Down Expand Up @@ -629,6 +630,10 @@ jobs:
echo "🎉 Release validation completed successfully!"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# This job has no checkout, so `gh` cannot infer the repository from a
# git remote and reported "GitHub release missing" for a release that
# actually existed.
GH_REPO: ${{ github.repository }}

- name: Notify on failure
if: failure()
Expand Down
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]

### Fixed
- Release workflow: `post-release-validation` now passes `-R <repo>` to `gh release view`,
so the check no longer fails with "GitHub release missing" in a job without a checkout.
- Release workflow: `post-release-validation` now sets `GH_REPO` for the step, so `gh`
resolves the repository in a job without a checkout instead of failing the check with
"GitHub release missing".
- Release workflow: the PyPI verification uses the PyPI JSON API with retries instead of
the experimental `pip index versions` plus a substring `grep`.
- Release workflow: `update-docs` opens a pull request with the changelog update instead of
Expand Down
Loading