What happens
When a workflow uses GitHub App tokens with discussions: write permission, gh aw compile emits permission-discussions: write as an input to actions/create-github-app-token. The action rejects it:
Warning: Unexpected input(s) 'permission-discussions', valid inputs are ['app-id', 'private-key', ...]
The warning is harmless at runtime (the input is silently ignored), but it indicates a code path that generates invalid configuration.
Originally reported in #18921. Scout analysis (triggered by @pelikhan) confirmed this is not an upstream bug — it is a gh-aw mapping issue.
What should happen
PermissionDiscussions should not be mapped to an actions/create-github-app-token input. The GitHub REST API for creating installation access tokens does not support discussions as a permission scope — it only exists at the GitHub App configuration level, not at the token level.
Where in the code
Invalid mapping:
pkg/workflow/safe_outputs_app.go:235-237 — maps PermissionDiscussions to permission-discussions:
if level, ok := permissions.Get(PermissionDiscussions); ok {
fields["permission-discussions"] = string(level)
}
Test asserting incorrect behavior:
pkg/workflow/safe_outputs_app_test.go:152-153 — asserts permission-discussions: write should be present in output
Related: permission-attestations may have the same issue:
- actions/create-github-app-token#310 reports the same pattern for
attestations
- If a similar mapping block exists for
PermissionAttestations in safe_outputs_app.go, it should be removed too
Evidence
Proposed fix
- Remove the 3-line
PermissionDiscussions mapping block in safe_outputs_app.go:235-237
- Add
PermissionDiscussions to the comment listing permissions with no GitHub App equivalent
- Check if
PermissionAttestations has the same pattern — if so, remove it too
- Update test assertions in
safe_outputs_app_test.go to remove expectations for the deleted mappings
- Run
make agent-finish to validate
What happens
When a workflow uses GitHub App tokens with
discussions: writepermission,gh aw compileemitspermission-discussions: writeas an input toactions/create-github-app-token. The action rejects it:The warning is harmless at runtime (the input is silently ignored), but it indicates a code path that generates invalid configuration.
Originally reported in #18921. Scout analysis (triggered by @pelikhan) confirmed this is not an upstream bug — it is a gh-aw mapping issue.
What should happen
PermissionDiscussionsshould not be mapped to anactions/create-github-app-tokeninput. The GitHub REST API for creating installation access tokens does not supportdiscussionsas a permission scope — it only exists at the GitHub App configuration level, not at the token level.Where in the code
Invalid mapping:
pkg/workflow/safe_outputs_app.go:235-237— mapsPermissionDiscussionstopermission-discussions:Test asserting incorrect behavior:
pkg/workflow/safe_outputs_app_test.go:152-153— assertspermission-discussions: writeshould be present in outputRelated:
permission-attestationsmay have the same issue:attestationsPermissionAttestationsinsafe_outputs_app.go, it should be removed tooEvidence
actions/create-github-app-tokenmaintainer (@parkerbxyz) confirmed in #307 thatdiscussionsis not a valid inputProposed fix
PermissionDiscussionsmapping block insafe_outputs_app.go:235-237PermissionDiscussionsto the comment listing permissions with no GitHub App equivalentPermissionAttestationshas the same pattern — if so, remove it toosafe_outputs_app_test.goto remove expectations for the deleted mappingsmake agent-finishto validate