Skip to content

feat: Add optional planning-token to Add Team Label action#257

Merged
Mrtenz merged 2 commits into
mainfrom
mrtenz/add-team-label-planning-token
Jun 1, 2026
Merged

feat: Add optional planning-token to Add Team Label action#257
Mrtenz merged 2 commits into
mainfrom
mrtenz/add-team-label-planning-token

Conversation

@Mrtenz
Copy link
Copy Markdown
Member

@Mrtenz Mrtenz commented Jun 1, 2026

With token-exchange-service we can only target a single repository per token, meaning we can't generate a token that can access both MetaMask/metamask-mobile (to add the label) and MetaMask/metamask-planning (to read the topology file). To support this, we need to use two separate tokens.


Note

Low Risk
Small CI composite-action input change; backward compatible when planning-token is omitted.

Overview
Adds an optional planning-token input to the Add Team Label composite action so workflows can use two GitHub tokens when a single token cannot reach both repos (e.g. token-exchange-service scoped to one repository).

The Get team label step now authenticates with planning-token when provided, otherwise falls back to team-label-token, for the gh api call that reads topology.json from MetaMask/metamask-planning. The Add team label step is unchanged and still uses team-label-token only to apply the label on the PR.

Callers that already have one token with access to both planning and the target repo do not need to pass the new input.

Reviewed by Cursor Bugbot for commit f4a22bc. Bugbot is set up for automated code reviews on this repo. Configure here.

@Mrtenz Mrtenz marked this pull request as ready for review June 1, 2026 10:06
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 02cfa9e. Configure here.

Comment thread .github/actions/add-team-label/action.yml Outdated
id: get-team-label
env:
GH_TOKEN: ${{ inputs.team-label-token }}
GH_TOKEN: ${{ inputs.planning-token || inputs.team-label-token }}
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.

Is this ever gonna use the team-label-token?

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.

Yeah, if planning-token (optional) is not specified.

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.

Yeah, I mean in practice, where would this be used versus the planning-token?

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.

It likely wouldn't, but we can't really fix that without a breaking change, and I want to avoid that (since it means bumping github-tools to v2 as a whole).

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.

Then I don't follow the change, can't we just pass in the planning token in the team-label-token parameter?

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.

Oh, for the job below it 🤔

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.

Yeah, token-exchange-service doesn't let us create a single token that works in both jobs.

@Mrtenz Mrtenz merged commit 6dc72a9 into main Jun 1, 2026
10 checks passed
@Mrtenz Mrtenz deleted the mrtenz/add-team-label-planning-token branch June 1, 2026 10:24
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