Add least-privilege permissions to GitHub Actions workflows - #1742
Conversation
Add explicit workflow-level permissions blocks to resolve CodeQL actions/missing-workflow-permissions alerts. Scopes are derived from workflow operations (git push, artifact upload, Danger, release lanes). Refs: APPSEC-164
Add explicit workflow-level permissions blocks to resolve CodeQL actions/missing-workflow-permissions alerts. Scopes are derived from workflow operations (git push, artifact upload, Danger, release lanes). Refs: APPSEC-164
Add explicit workflow-level permissions blocks to resolve CodeQL actions/missing-workflow-permissions alerts. Scopes are derived from workflow operations (git push, artifact upload, Danger, release lanes). Refs: APPSEC-164
Add explicit workflow-level permissions blocks to resolve CodeQL actions/missing-workflow-permissions alerts. Scopes are derived from workflow operations (git push, artifact upload, Danger, release lanes). Refs: APPSEC-164
Add explicit workflow-level permissions blocks to resolve CodeQL actions/missing-workflow-permissions alerts. Scopes are derived from workflow operations (git push, artifact upload, Danger, release lanes). Refs: APPSEC-164
Add explicit workflow-level permissions blocks to resolve CodeQL actions/missing-workflow-permissions alerts. Scopes are derived from workflow operations (git push, artifact upload, Danger, release lanes). Refs: APPSEC-164
Add explicit workflow-level permissions blocks to resolve CodeQL actions/missing-workflow-permissions alerts. Scopes are derived from workflow operations (git push, artifact upload, Danger, release lanes). Refs: APPSEC-164
Add explicit workflow-level permissions blocks to resolve CodeQL actions/missing-workflow-permissions alerts. Scopes are derived from workflow operations (git push, artifact upload, Danger, release lanes). Refs: APPSEC-164
Add explicit workflow-level permissions blocks to resolve CodeQL actions/missing-workflow-permissions alerts. Scopes are derived from workflow operations (git push, artifact upload, Danger, release lanes). Refs: APPSEC-164
WalkthroughNine GitHub Actions workflow files gain explicit ChangesWorkflow Permissions Hardening
Estimated code review effort: 1 (Trivial) | ~5 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
.github/workflows/e2e-test-cron.yml (1)
21-24: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick winScope
actions: writeto the artifact-uploading jobs
Keepcontents: readat the workflow level, but moveactions: writeonto bothbuild-compose-apksandrun-compose-tests-nightly;slackdoesn’t need it.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/e2e-test-cron.yml around lines 21 - 24, The workflow currently grants actions: write at the top level, but this permission should be scoped only to the artifact-uploading jobs. Keep contents: read at the workflow level, and move actions: write onto the build-compose-apks and run-compose-tests-nightly jobs only; leave slack without that permission.Source: Linters/SAST tools
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/e2e-build.yml:
- Around line 12-14: The workflow permissions are broader than needed because
the e2e-build job grants actions: write even though the referenced actions only
require read access. Update the permissions block in the e2e-build workflow to
remove the actions scope and keep only contents: read, so the job runs with
least privilege.
---
Nitpick comments:
In @.github/workflows/e2e-test-cron.yml:
- Around line 21-24: The workflow currently grants actions: write at the top
level, but this permission should be scoped only to the artifact-uploading jobs.
Keep contents: read at the workflow level, and move actions: write onto the
build-compose-apks and run-compose-tests-nightly jobs only; leave slack without
that permission.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: f5ed9698-6507-40eb-b5c1-31c763a16829
📒 Files selected for processing (9)
.github/workflows/android.yml.github/workflows/app-distribute.yml.github/workflows/e2e-build.yml.github/workflows/e2e-test-cron.yml.github/workflows/e2e-test.yml.github/workflows/internal-app-distribute.yml.github/workflows/no-response.yml.github/workflows/publish-new-version.yml.github/workflows/sdk-size-updates.yml
SDK Size Comparison 📏
|
PR checklist ✅All required conditions are satisfied:
🎉 Great job! This PR is ready for review. |
|
|
🚀 Available in v1.29.0 |




Goal
Add least-privilege
permissionsblocks to GitHub Actions workflows to resolve CodeQLactions/missing-workflow-permissionsalerts (APPSEC-164).Implementation
permissionsblocks across GitHub Actions workflows.contents: read,pull-requests: read).Testing