Skip to content

Declare contents: read on the seven workflows without an explicit scope#2558

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

Declare contents: read on the seven workflows without an explicit scope#2558
arpitjain099 wants to merge 1 commit into
google:mainfrom
arpitjain099:ci/add-permissions

Conversation

@arpitjain099
Copy link
Copy Markdown

Seven workflows in .github/workflows/ currently leave GITHUB_TOKEN scope implicit:

  • Pure CI: cloud-init-image-for-cuttlefish, gigabyte-ampere-cuttlefish-installer, presubmit — all check out the repo and run build/test/lint inside debian containers or Ubuntu runners. No writes.
  • Deploy / cache callers: postsubmit, scheduled-cache-update, stable-channel, unstable-channel — each delegates to update-cache-and-deployment.yaml with secrets. The reusable uses google-github-actions/auth@v3 to authenticate to GCP via the ARTIFACT_REGISTRY_UPLOADER JSON-creds secret (not OIDC), so it doesnt need id-token: write. contents: readcovers the checkout in the reusable and stays consistent with whatupdate-cache-and-deployment.yaml` actually needs.

YAML validates locally.

Two pure-CI workflows (cloud-init-image-for-cuttlefish, gigabyte-ampere) check
out the repo and build packages/images inside debian containers.

presubmit.yaml has multiple read-only jobs (buildozer, staticcheck, frontend
unit tests, etc.).

The four deploy/cache callers (postsubmit, scheduled-cache-update, stable-channel,
unstable-channel) all delegate to update-cache-and-deployment.yaml, which uses
google-github-actions/auth@v3 with the ARTIFACT_REGISTRY_UPLOADER JSON-creds
secret. The GCP auth path doesn't need GITHUB_TOKEN write scopes; contents:
read is enough for the checkout step in the reusable.

Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
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.

1 participant