Skip to content

Declare workflow-level permissions for CI and TODO-to-Issue#3734

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

Declare workflow-level permissions for CI and TODO-to-Issue#3734
arpitjain099 wants to merge 1 commit into
google:masterfrom
arpitjain099:ci/add-permissions

Conversation

@arpitjain099
Copy link
Copy Markdown

Note: .github/ is in this repos .gitignore, so this commit uses git add -f` to override the ignore for these workflow files. I assume the gitignore entry is incidental rather than deliberate — happy to update the gitignore in this PR if maintainers prefer.

Two workflows declared no permissions: block:

  • ci.ymlgradle assembleDebug + lint + unit tests. contents: read covers checkout.
  • todo-to-issue.yml — uses alstr/todo-to-issue-action to find TODO comments in a PR, create issues for them, rewrite the TODOs inline with the new issue URLs, and git push those rewrites back. Needs:
    • contents: write — the inline rewrite + git push origin "$HEAD_REF" step
    • issues: write — the action creates issues via the Issues API

The job is gated on github.event.pull_request.head.repo.full_name == github.repository, so it never runs on fork PRs.

test-e2e.yml and e2e-dispatch.yml in this repo already use the explicit-permissions convention.

ci.yml: contents: read (gradle build + unit tests + lint).
todo-to-issue.yml: contents: write + issues: write because
alstr/todo-to-issue-action creates issues for TODO comments and pushes the
rewritten files back to the PR head branch.

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