Skip to content

fix(release): upload + publish steps use GITHUB_TOKEN to access drafts#441

Merged
BryanFRD merged 1 commit into
mainfrom
fix/publish-upload-uses-github-token
May 14, 2026
Merged

fix(release): upload + publish steps use GITHUB_TOKEN to access drafts#441
BryanFRD merged 1 commit into
mainfrom
fix/publish-upload-uses-github-token

Conversation

@BryanFRD
Copy link
Copy Markdown
Contributor

Follow-up to #439 + #440. v4.7.4 Publish failed at the Upload step — gh release upload returned release not found because FERRFLOW_TOKEN PAT can't see drafts. Same scope issue. Fixed by switching the upload + publish steps to GITHUB_TOKEN (job-level contents: write is sufficient). The publish step's ferrflow release only calls find_draft_release + publish_release (GitHub API, no git push) so GITHUB_TOKEN works there too.`

Copilot AI review requested due to automatic review settings May 14, 2026 13:42
@BryanFRD BryanFRD merged commit 230b0a8 into main May 14, 2026
12 of 14 checks passed
@BryanFRD BryanFRD deleted the fix/publish-upload-uses-github-token branch May 14, 2026 13:43
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes the GitHub Release publish pipeline by switching the asset upload and draft publish steps in the Publish workflow to authenticate with the workflow-scoped GITHUB_TOKEN, which has the necessary access to draft releases when permissions: contents: write is granted at the job level.

Changes:

  • Use secrets.GITHUB_TOKEN for gh release upload so uploads can target draft releases reliably.
  • Use secrets.GITHUB_TOKEN for ./target/release/ferrflow release so publishing drafts works with the same token permissions.
  • Add inline workflow documentation explaining why GITHUB_TOKEN is required for these draft-release operations.

Comment on lines 195 to +198
run: ./target/release/ferrflow release
env:
FERRFLOW_TOKEN: ${{ secrets.FERRFLOW_TOKEN }}
GITHUB_TOKEN: ${{ secrets.FERRFLOW_TOKEN }}
FERRFLOW_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Comment on lines 170 to +179
- name: Upload assets to draft release
# Same scope reason as the wait step above: FERRFLOW_TOKEN
# (fine-grained PAT) lacks the `Releases: write` scope needed
# for `gh release upload` against a draft. v4.7.4 failed here
# with "release not found" because gh CLI internally hits
# /repos/.../releases/tags/<tag> which excludes drafts, and
# then falls back to a list call the PAT can't see. The
# job-level `permissions: contents: write` grants GITHUB_TOKEN
# everything needed to write to draft release assets on the
# workflow's own repo.
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Benchmark

Details
Benchmark suite Current: eb9f6f2 Previous: 0b5fe57 Ratio
full_check_flow/100_commits 2663164 ns/iter (± 71301)
full_check_flow/1000_commits 27507050 ns/iter (± 348205)

This comment was automatically generated by workflow using github-action-benchmark.

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