Skip to content

refactor: Extract auto-approve repo list into a text file#7119

Merged
BYK merged 1 commit intomainfrom
refactor/auto-approve-repo-list
Feb 11, 2026
Merged

refactor: Extract auto-approve repo list into a text file#7119
BYK merged 1 commit intomainfrom
refactor/auto-approve-repo-list

Conversation

@BYK
Copy link
Member

@BYK BYK commented Feb 10, 2026

Summary

  • Moves the auto-approve repo list from a 40-line startsWith() chain in the workflow if: condition into a plain text file (auto-approve-repos.txt), one repo per line.
  • The workflow now does a sparse checkout of just that file and uses grep -qxF for exact matching against the repo name extracted from the issue title.
  • The job-level if: still gates on the actor and a publish: title prefix so unrelated issues skip the job entirely (no checkout, no token).
  • Removes the getsentry-release actor check since only the GitHub App bot opens these issues now.
  • Passes the issue title through an env var instead of inline ${{ }} to prevent shell injection.

Maintenance

To opt-in a new repo for auto-approval, add a line to auto-approve-repos.txt. No workflow YAML editing needed.

@BYK BYK marked this pull request as ready for review February 10, 2026 21:57
@BYK BYK requested a review from a team as a code owner February 10, 2026 21:57
@BYK BYK requested a review from Jeffreyhung February 10, 2026 21:57
Copy link
Member

@Jeffreyhung Jeffreyhung left a comment

Choose a reason for hiding this comment

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

one minor nit but LGTM!

BYK added a commit that referenced this pull request Feb 10, 2026
## Summary

- Add least-privilege `permissions` blocks to the 3 workflows flagged by
  CodeQL for `actions/missing-workflow-permissions` (alerts #2, #5, #6).
- `test.yml`: `contents: read` (only checks out code and runs tests)
- `publish.yml`: `contents: read` + `issues: write` (checkout + issue
comments/labels/close via `GITHUB_TOKEN`; cross-repo ops use the Release
  Bot app token)
- `auto-approve.yml`: `contents: read` (needed for the sparse checkout
  being added in #7119; currently no `GITHUB_TOKEN` write usage)

Resolves all 3 open code-scanning alerts.
Move the list of auto-approved repos from a long chain of startsWith()
conditions in the workflow YAML into a plain text file (one repo per line).

The workflow now does a sparse checkout of just that file and uses
grep to match the repo extracted from the issue title. The job-level
if-condition still gates on the actor and a 'publish: ' title prefix
so unrelated issues skip the job entirely.

Also removes the getsentry-release actor check (only the GitHub App
bot opens these issues now) and passes the issue title through an env
var instead of inline ${{ }} interpolation to prevent shell injection.
@BYK BYK force-pushed the refactor/auto-approve-repo-list branch from 58cf800 to b221b88 Compare February 11, 2026 10:03
@BYK BYK merged commit 0256ae1 into main Feb 11, 2026
7 checks passed
@BYK BYK deleted the refactor/auto-approve-repo-list branch February 11, 2026 10:05
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