Skip to content

ci: declare contents: read on seven workflows missing a permissions block#5687

Closed
arpitjain099 wants to merge 1 commit into
google:mainfrom
arpitjain099:ci/add-permissions
Closed

ci: declare contents: read on seven workflows missing a permissions block#5687
arpitjain099 wants to merge 1 commit into
google:mainfrom
arpitjain099:ci/add-permissions

Conversation

@arpitjain099
Copy link
Copy Markdown
Contributor

Seven workflows do not declare permissions:, so the default GITHUB_TOKEN scope applies. All of them only need read access for actions/checkout from the default token:

  • check-file-contents.yml, mypy-new-errors.yml, mypy.yml, pre-commit.yml, python-unit-tests.yml — pure CI.
  • discussion_answering.yml writes back to discussions but does so via secrets.ADK_TRIAGE_AGENT (explicitly overrides GITHUB_TOKEN in the step env). The default GITHUB_TOKEN itself only does checkout, so contents: read is the correct floor.
  • upload-adk-docs-to-vertex-ai-search.yml authenticates to GCP with secrets.ADK_GCP_SA_KEY for Vertex AI uploads; no GitHub write API is touched.

copybara-pr-handler, issue-monitor, and gemini-invoke already declare permissions explicitly; this PR brings the remaining seven in line.

YAML validates locally.

All seven workflows only check out the repo and run reads.

The discussion_answering workflow does write back (creating discussion
replies), but it uses an external 'secrets.ADK_TRIAGE_AGENT' token for that,
explicitly overriding GITHUB_TOKEN in the env block. The default GITHUB_TOKEN
itself only does checkout - contents: read suffices.

upload-adk-docs-to-vertex-ai-search uses google-github-actions/auth via
ADK_GCP_SA_KEY for Vertex AI Search uploads, never touching GitHub APIs for
writes.

Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
@arpitjain099 arpitjain099 force-pushed the ci/add-permissions branch 2 times, most recently from 38a737b to c145c10 Compare May 13, 2026 17:13
@arpitjain099
Copy link
Copy Markdown
Contributor Author

Hi @xuanyang15, gentle ping on this. PR has been open for 4 days without review. I noticed you've been on the recent-merger side of recent merges in this repo. When you have a moment, would you mind giving it a quick look? No urgency. Happy to address any feedback.

@xuanyang15 xuanyang15 self-assigned this May 18, 2026
@xuanyang15
Copy link
Copy Markdown
Collaborator

@arpitjain099 Thanks for creating this PR! It is waiting for internal review now.

copybara-service Bot pushed a commit that referenced this pull request May 18, 2026
…lock

Merge #5687

Co-authored-by: Xuan Yang <xygoogle@google.com>
COPYBARA_INTEGRATE_REVIEW=#5687 from arpitjain099:ci/add-permissions c145c10
PiperOrigin-RevId: 917369094
@adk-bot
Copy link
Copy Markdown
Collaborator

adk-bot commented May 18, 2026

Thank you @arpitjain099 for your contribution! 🎉

Your changes have been successfully imported and merged via Copybara in commit e7ca943.

Closing this PR as the changes are now in the main branch.

@adk-bot adk-bot closed this May 18, 2026
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.

3 participants