Skip to content

Use OctoSTS for release draft conversion - #1309

Merged
danbarr merged 1 commit into
mainfrom
fix-release-draft-token
Nov 2, 2026
Merged

danbarr merged 1 commit into
mainfrom
fix-release-draft-token

Conversation

@danbarr

@danbarr danbarr commented Nov 2, 2026

Copy link
Copy Markdown
Collaborator

Description

The trusted augment run for ToolHive v0.60.0 fails at convertPullRequestToDraft with Resource not accessible by integration, before checking out the PR or refreshing any references. The draft-conversion step still inherited GITHUB_TOKEN after #1298 reduced that token to contents: read; all OctoSTS exchanges were either bootstrap-only or later in the job.

Exchange a fresh OctoSTS token immediately before draft conversion and pass it only to that step. Reuse the existing release policy, which grants contents: write and pull_requests: write, while keeping the default job token's content access read-only. The PR checkout, generated-reference refresh, and Claude session sequence remain unchanged.

Add a CI regression test that executes the workflow's draft-conversion shell with a stubbed GitHub CLI and resolves its token from the workflow configuration. It covers a ready PR, an already-draft PR, and a rejected mutation. The ready-PR test fails against the original workflow.

Type of change

  • Bug fix (release workflow authentication)

Related issues/PRs

Validation

  • npm run build
  • Five release workflow/PR body helper tests passed; the new conversion test fails against the pre-fix workflow
  • Prettier and ESLint on changed files, plus git diff --check
  • zizmor --offline .github/workflows .github/actions
  • Actionlint on changed workflows, excluding existing unsupported $/ syntax diagnostics and existing ShellCheck style suggestions

Live OctoSTS exchange and draft conversion still need verification after merge. Dispatch a fresh run on updated main for PR #1307; rerunning the failed run would use its original workflow revision.

Submitter checklist

Content and formatting

  • I have reviewed the content for technical accuracy
  • I have reviewed the content for spelling, grammar, and style

Reviewer checklist

Content

  • I have reviewed the content for technical accuracy
  • I have reviewed the content for spelling, grammar, and style

Copilot AI balanced review requested due to automatic review settings November 2, 2026 22:59
@vercel

vercel Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docs-website Ready Ready Preview Nov 2, 2026 11:03pm UTC

Request Review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Regression tests mock token issuance and GitHub authorization, leaving the live OctoSTS exchange and app-authorized draft conversion unverified until a fresh dispatch on updated main for PR #1307.

No open issues 🎉

What changed in this PR

Fixes release PR draft conversion after #1298 restricted the default workflow token. The conversion step now uses a fresh OctoSTS token while preserving the existing checkout and augmentation sequence.

Changes:

  • Adds a dedicated OctoSTS token exchange immediately before draft conversion.
  • Adds regression tests for ready PRs, already-draft PRs, and rejected mutations, and includes them in CI.
File Description
scripts/​upstream-release/​workflow.test.mjs Tests draft conversion using workflow-resolved credentials and a stubbed GitHub CLI.
.github/​workflows/​upstream-release-docs.yml Obtains and passes an OctoSTS token to the draft-conversion step.
.github/​workflows/​_static-checks.yaml Runs the new workflow tests alongside release PR body tests.

Review effort: Balanced

@danbarr
danbarr merged commit bd0f05a into main Nov 2, 2026
8 checks passed
@danbarr
danbarr deleted the fix-release-draft-token branch November 2, 2026 23:42

This branch was successfully deployed

1 active deployment
Preview — b2fa3ff0 Deployed Nov 2, 2026 by vercel[bot]
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.

3 participants