You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Conclusion job's GitHub App token is minted with safe-output permissions, not the conclusion job's #73521
With safe-outputs.github-app, buildConclusionJobSteps (pkg/workflow/notify_comment_conclusion_helpers.go:51) mints the conclusion job's App token from ComputePermissionsForSafeOutputs(data.SafeOutputs) plus checks: read. But every reporting step in that job uses that token:
Handle agent failure
Report failed jobs
Log detection run
Record incomplete
Process no-op messages
computeConclusionJobPermissions (pkg/workflow/notify_comment.go:167) already works out what those steps need: actions: read, plus issues: write when conclusionMayCreateIssue. Those permissions go only to GITHUB_TOKEN, never to the App mint. So:
Any workflow:report_failed_jobs.cjs can't call listJobsForWorkflowRun, and logs "Skipping failed jobs reporting: token lacks actions:read".
Seen on v0.93.5 and v1.0.1. A one-workflow lock shows conclusion permissions: {actions: read, issues: write, ...}, while its mint asks only for permission-issues: write, or only permission-pull-requests: write. safe-outputs.github-app.permissions rejects both actions and issues, so there's no workaround in frontmatter.
Implementation Plan
In notify_comment_conclusion_helpers.go, mint the conclusion App token from computeConclusionJobPermissions(data) instead of ComputePermissionsForSafeOutputs + addAgentFailureChecksPermission.
No extra filtering is needed: convertPermissionsToAppTokenFields already skips scopes with no App equivalent, such as id-token and models.
Tests
notify_comment_test.go, for safe-outputs.github-app with only create-pull-request-review-comment:
the conclusion mint has permission-actions: read and permission-issues: write;
with report-failure-as-issue: false and report-failed-jobs: false, it has no permission-issues.
Recompile the existing lock fixtures.
Acceptance criterion
The conclusion job's App mint includes every App-mappable scope that the conclusion job's own permissions: include.
Activity