Skip to content

Commit bf67397

Browse files
GWealecopybara-github
authored andcommitted
ci: limit the PR triage job token to read-only
The PR triage job runs under pull_request_target on every new pull request, including ones from forks, and nothing in it uses the job token's pull-requests write grant, since the triage script signs in with the ADK_TRIAGE_AGENT secret, so the grant only gave a compromised step the power to edit pull requests. Drops that grant so the job token can only read repository contents, and fixes the comment that said this token does the assigning. Co-authored-by: George Weale <[email protected]> PiperOrigin-RevId: 1006805428
1 parent da35ca7 commit bf67397

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎.github/workflows/pr-triage.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ name: ADK Pull Request Triaging Agent
1717
on:
1818
# React within seconds of a PR arriving so the owner is assigned promptly.
1919
# pull_request_target (not pull_request) is required so the run has the
20-
# base-repo token needed to assign on community fork PRs; this workflow only
21-
# reads PR metadata via the API and never checks out untrusted PR code.
20+
# ADK_TRIAGE_AGENT secret needed to assign on community fork PRs; this
21+
# workflow only reads PR metadata via the API and never checks out untrusted
22+
# PR code.
2223
#
2324
# Only events that bring in a new PR are listed. Pushes to an open PR and a
2425
# periodic backfill would both re-assign an owner a maintainer had just taken
@@ -48,7 +49,6 @@ jobs:
4849
if: github.repository == 'google/adk-python'
4950
runs-on: ubuntu-latest
5051
permissions:
51-
pull-requests: write
5252
contents: read
5353

5454
steps:

0 commit comments

Comments
 (0)