Skip to content

fix(ci): split vouch gate into two steps with separate tokens#446

Merged
johntmyers merged 1 commit intomainfrom
fix/vouch-check-split-tokens
Mar 18, 2026
Merged

fix(ci): split vouch gate into two steps with separate tokens#446
johntmyers merged 1 commit intomainfrom
fix/vouch-check-split-tokens

Conversation

@johntmyers
Copy link
Collaborator

Summary

  • The previous fix (fix(ci): use ORG_READ_TOKEN for org membership check in vouch gate #445) used ORG_READ_TOKEN for the entire github-script step, but that token only has read:org scope — it can't close PRs, post comments, or read repo content. NVIDIA's enterprise policy also rejected the classic PAT due to lifetime > 366 days.
  • Splits the workflow into two steps with separate tokens so each token only does what it has permission to do

Related Issue

Follow-up to #442, #444, #445. Fixes #430 / #431.

Changes

  • .github/workflows/vouch-check.yml:
    • Step 1 (org-check): Uses ORG_READ_TOKEN exclusively for orgs.checkMembershipForUser. Returns 'skip' if the author is an org member.
    • Step 2: Uses default GITHUB_TOKEN (has contents: read + pull-requests: write). Only runs if step 1 didn't return 'skip'. Handles bot check, VOUCHED.td lookup, and closing unvouched PRs.

Action Required

The current ORG_READ_TOKEN was rejected by NVIDIA's enterprise policy:

The 'NVIDIA Corporation' enterprise forbids access via personal access tokens (classic) if the token's lifetime is greater than 366 days.

Regenerate the PAT at https://github.com/settings/tokens/3788283427 with expiry ≤ 366 days, or create a new fine-grained PAT.

Checklist

  • Follows Conventional Commits format
  • No new dependencies introduced

The ORG_READ_TOKEN (read:org PAT) was being used for all API calls,
including closing PRs and posting comments, which it lacks permissions
for. Split into two steps:

1. Org membership check — uses ORG_READ_TOKEN exclusively
2. VOUCHED.td check + close — uses default GITHUB_TOKEN (has repo write)

Step 2 is skipped entirely if step 1 confirms org membership.
@johntmyers johntmyers requested a review from a team as a code owner March 18, 2026 16:26
@johntmyers johntmyers merged commit e26732b into main Mar 18, 2026
9 of 10 checks passed
@johntmyers johntmyers deleted the fix/vouch-check-split-tokens branch March 18, 2026 16:29
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.

1 participant