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
safe-outputs.github-app mint includes permissions of handlers that set their own github-token #73522
computePermissionsForSafeOutputs(safeOutputs, excludePerHandlerApps) (pkg/workflow/safe_outputs_permissions.go:134) skips a handler's permissions only when the handler has its own github-app (getHandlerGitHubApp, safe_output_handlers.go:776). A handler with its own github-token still adds its scopes to the global App mint, even though it never uses that token.
What happens: the safe_outputs and conclusion App mints get permission-actions: write, while dispatch_workflow runs with GITHUB_TOKEN, checked in GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG.
Why it matters: the App token then holds actions: write it doesn't need: it could dispatch, cancel or re-run workflows and delete logs. That's in jobs that process agent output.
Workaround: none in frontmatter, since github-app.permissions rejects actions.
Seen on v0.93.5 and v1.0.1.
Implementation Plan
Add getHandlerGitHubToken(config, fieldName) next to getHandlerGitHubApp. It reads GitHubToken directly, or from the embedded BaseSafeOutputConfig.
In computePermissionsForSafeOutputs, when computing permissions for the App mint (excludePerHandlerApps == true), also skip handlers with a non-empty handler-level github-token.
Leave job-level GITHUB_TOKEN permissions (excludePerHandlerApps == false) unchanged: a handler token of secrets.GITHUB_TOKEN still needs them.
Activity