Repository navigation
fix(ci): pass app token to Publish draft release step - #2532
Conversation
The Publish draft release step used the workflow's default GITHUB_TOKEN, which does not return draft releases from listReleases — so the script failed with "Draft release for vX.Y.Z not found" and every release tag had to be undrafted manually. This same bug was fixed once before in 4db55ac ([ci] Add Github token to fetch draft releases) by adding github-token: GH_PAT to the listing step. It was lost during the refactor in 66a756b that combined the separate listing/flags/publish steps into a single Publish step, and not restored when f96b2da migrated remaining github-token usages from GH_PAT to the cozystack-ci App token. Add github-token: app-token.outputs.token to the merged step so it shares the same auth as the rest of the workflow. Assisted-By: Claude <[email protected]> Signed-off-by: Myasnikov Daniil <[email protected]>
|
Note Gemini is unable to generate a summary for this pull request due to the file types involved not being currently supported. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe GitHub Actions workflow is updated to explicitly authenticate the "Publish draft release" step using the GitHub App token generated by the prior Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.Comment |
IvanHunters
left a comment
There was a problem hiding this comment.
Root cause is well-documented (the fix was present in 4db55ac, dropped silently in 66a756b, and missed by the App-token migration in f96b2da because that migration only touched steps that already had github-token:). One-line fix is correct — the step needs the app token to see draft releases via listReleases.
LGTM
|
Successfully created backport PR for |
|
Successfully created backport PR for |
What this PR does
Adds an explicit
github-token: ${{ steps.app-token.outputs.token }}to thePublish draft releasestep in.github/workflows/pull-requests-release.yaml.Without this, the step uses the workflow's default
GITHUB_TOKEN, which does not return draft releases vialistReleases. As a result the script throwsDraft release for vX.Y.Z not foundon every release-X.Y.Z PR merge — see e.g. the recent v1.3.1 finalize run https://github.com/cozystack/cozystack/actions/runs/25102689625, plus identical failures on v1.3.0, v1.0.0-beta.5, v1.0.0-alpha.2, v0.39.4, v0.32.x, v0.31.x. Maintainers have been undrafting each release manually.This bug was fixed once before in 4db55ac (
[ci] Add Github token to fetch draft releases) by settinggithub-token: ${{ secrets.GH_PAT }}on the listing step. It was lost in the refactor in 66a756b (fix(ci): ensure correct latest release after backport publishing), which collapsed the separateFind draft release/Calculate publish flags/Publish draft releasesteps into one combined step without carrying thegithub-tokenover. The April 2026 App-token migration in f96b2da only updated steps that already had agithub-token:field, so the publish step was left with the default token.Release note
Summary by CodeRabbit