Repository navigation
fix(community-autotag): apply the community label as github-actions[bot], not the PAT owner - #157
Open
jashansinghTT wants to merge 1 commit into
Conversation
The "Ensure community label exists" and "Apply community label" steps authenticated with AUTOLABEL_COMMUNITY_ISSUES, so every `community` label event was attributed to the PAT's owner (tenstorrent-github-bot in tt-flash / tt-kmd today, or whichever employee's PAT a repo happens to hold). Switch those two steps to the built-in github.token so the label is created and applied by github-actions[bot]. The PAT is still used for the one thing the built-in token cannot do: read org membership (including private members). Callers already grant issues: write and pull-requests: write, which is all the label steps need. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
The collaborator lookup still requires repository access beyond the documented read:org scope.
Pull request overview
Updates community labeling to use the built-in GitHub token so actions are attributed to github-actions[bot].
Changes:
- Uses
github.tokenfor label creation and application. - Retains the PAT for organization membership checks.
- Clarifies token usage and required permissions.
File summaries
| File | Description |
|---|---|
.github/workflows/issues-community-autotag.yml |
Separates membership authentication from label mutation authentication. |
Review details
Suppressed comments (1)
.github/workflows/issues-community-autotag.yml:7
- This description now says the secret is used only for org membership and can be narrowed to
read:org, but the step also callsGET /repos/.../collaborators/${USERNAME}at lines 99-103. That endpoint requires repository metadata access (andrepoin addition toread:orgfor a classic PAT), so the advertised scope makes the collaborator check return 403/404 and misreports collaborators asexternal_user; either remove this redundant lookup or document/retain its required repository permission.
description: 'Token used only to check organization membership (needs read:org). Labels are applied with the built-in github.token so they are attributed to github-actions[bot].'
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
In
issues-community-autotag.yml, the two steps that create and apply thecommunitylabel now authenticate with the built-ingithub.tokeninstead of theAUTOLABEL_COMMUNITY_ISSUESPAT. The membership check keeps using the PAT, because the built-in token cannot read org membership.Why
Every
communitylabel event is currently attributed to whoever owns the PAT. In tt-flash and tt-kmd that istenstorrent-github-bot; in repos that stored an employee's PAT it is that employee. The label should visibly come from automation, i.e.github-actions[bot].Effect on callers
None required. The template caller (
repo-community-labeling.ymlintenstorrent/.github) already grantsissues: writeandpull-requests: write, and this workflow's job declares the same, which is allgh issue edit --add-label/gh pr edit --add-labeland label creation need. The PAT can now be narrowed toread:orgonly.Not changed here
pull_requestfrom forks still gets no secrets, so the membership step fails on fork PRs. That needspull_request_targetsupport and is a separate change.🤖 Generated with Claude Code