Skip to content

ci: replace RTagBot with release branch workflow - #822

Merged
randy3k merged 1 commit into
masterfrom
ci/release-workflow
Oct 31, 2026
Merged

randy3k merged 1 commit into
masterfrom
ci/release-workflow

Conversation

@randy3k

@randy3k randy3k commented Oct 29, 2026

Copy link
Copy Markdown
Member

Summary

  • Add a GitHub Actions workflow (.github/workflows/release.yml) that tags v<version> and publishes a GitHub release with notes from NEWS.md whenever a release/* branch PR is merged into main or master.
  • Validate that the release/<version> branch matches Version: in DESCRIPTION at the merged commit.
  • Remove the scheduled RTagBot workflow (.github/workflows/tagbot.yml).

@randy3k
randy3k force-pushed the ci/release-workflow branch from 3e042df to ab94dcb Compare October 29, 2026 02:54
@randy3k randy3k assigned randy3k and renkun-ken and unassigned randy3k Oct 29, 2026

@renkun-ken renkun-ken left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I found two cases where this can fail to publish the intended release. I exercised the workflow shell block against temporary Git repositories with a mocked gh: the fresh-tag path used the merge commit and extracted the expected notes, but an existing tag at an older commit produced a successful release for that older commit. All 18 current checks pass; they do not run the release job.

Comment thread .github/workflows/release.yml Outdated
name: Release

on:
pull_request:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

[P2] Merged release PRs from forks cannot publish with this event. The job accepts any head branch named release/<version>, including one in a fork, but GitHub gives pull_request workflows triggered from forks a read-only GITHUB_TOKEN even when contents: write is requested. Consequently the tag push (or release creation if the tag exists) fails after the PR is merged, and removing TagBot leaves no automatic release. Please use a write-capable post-merge event or otherwise handle fork-origin release PRs; if using pull_request_target, gate on the merged state and only check out the trusted merge commit. GitHub documents the fork-token restriction.

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.

Switched to pull_request_target: types: [closed] (gated on merged == true and checking out merge_commit_sha) in ec36929.

Comment thread .github/workflows/release.yml Outdated
in_section { print }
' NEWS.md | sed -e '/./,$!d' -e :a -e '/^[[:space:]]*$/{$d;N;ba' -e '}' > "$NOTES_FILE"

if ! git ls-remote --exit-code --tags origin "refs/tags/$TAG" >/dev/null 2>&1; then

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

[P2] Verify that an existing tag points to the merged commit before reusing it. If v<version> was previously pushed at a different commit and has no GitHub release, this check skips creating the tag, and gh release create --verify-tag only verifies that the tag exists. The job then succeeds while publishing source archives from the old commit with notes read from the new merge commit. I reproduced this with a pre-existing tag on the parent commit. Resolve the remote tag to a commit and fail on a mismatch; still allow a matching tag for retries.

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.

Added remote tag target SHA verification against MERGE_SHA in ec36929.

@randy3k
randy3k force-pushed the ci/release-workflow branch from ab94dcb to ec36929 Compare October 31, 2026 04:06
@randy3k
randy3k requested a review from renkun-ken October 31, 2026 04:13
@randy3k
randy3k merged commit ebf9cac into master Oct 31, 2026
18 checks passed
@randy3k
randy3k deleted the ci/release-workflow branch October 31, 2026 05:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants