fix(ci): add workflow-level permissions for PR comments#663
Open
morluto wants to merge 1 commit intogarrytan:mainfrom
Open
fix(ci): add workflow-level permissions for PR comments#663morluto wants to merge 1 commit intogarrytan:mainfrom
morluto wants to merge 1 commit intogarrytan:mainfrom
Conversation
867ad38 to
12055d1
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.
Summary
Fix the
reportjob in the E2E Evals workflow failing with:The Problem
When a PR is opened, the workflow runs 12 parallel eval suites, then the
reportjob attempts to post a summary comment on the PR with results.The
reportjob fails because the GitHub token lackspull-requests: writepermission, even though the permission was declared at the job level.Why It Matters
Root Cause
GitHub Actions does not reliably propagate job-level
permissions:blocks when:pull_request(which grants a read-only token by default)needs:dependencies between jobsThe runner logs showed effective permissions as only
Contents: readdespite the job-level declaration.The Fix
Move
permissions:from thereportjob to workflow level. This ensures permissions are granted before any job executes, regardless of dependencies.Testing
To verify the fix:
reportjob: It should complete with statussuccess(notfailure)Before fix:
reportjob: ❌ failed with exit code 1After fix:
reportjob: ✅ success