ci: declare contents: read on seven workflows missing a permissions block#5687
Open
arpitjain099 wants to merge 1 commit into
Open
ci: declare contents: read on seven workflows missing a permissions block#5687arpitjain099 wants to merge 1 commit into
arpitjain099 wants to merge 1 commit into
Conversation
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>
38a737b to
c145c10
Compare
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.
Seven workflows do not declare
permissions:, so the default GITHUB_TOKEN scope applies. All of them only need read access foractions/checkoutfrom the default token:check-file-contents.yml,mypy-new-errors.yml,mypy.yml,pre-commit.yml,python-unit-tests.yml— pure CI.discussion_answering.ymlwrites back to discussions but does so viasecrets.ADK_TRIAGE_AGENT(explicitly overridesGITHUB_TOKENin the step env). The default GITHUB_TOKEN itself only does checkout, socontents: readis the correct floor.upload-adk-docs-to-vertex-ai-search.ymlauthenticates to GCP withsecrets.ADK_GCP_SA_KEYfor Vertex AI uploads; no GitHub write API is touched.copybara-pr-handler,issue-monitor, andgemini-invokealready declare permissions explicitly; this PR brings the remaining seven in line.YAML validates locally.