feat: add permissions input to narrow minted installation tokens#141
Merged
MarshallOfSound merged 4 commits intomainfrom Apr 24, 2026
Merged
feat: add permissions input to narrow minted installation tokens#141MarshallOfSound merged 4 commits intomainfrom
MarshallOfSound merged 4 commits intomainfrom
Conversation
Adds an optional `permissions` input, parsed as YAML, that forwards to the underlying `@electron/github-app-auth` library's `AuthNarrowing` argument. Callers can now mint installation tokens scoped to a subset of the App's permissions — e.g. a read-only token for a checkout-only job, or a contents-write token for a push job — rather than always receiving the App's full installation scope. Leaving the input empty preserves prior behavior (unnarrowed token).
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
VerteDinde
approved these changes
Apr 24, 2026
The post step called revokeInstallationAccessToken() without awaiting it, so the surrounding try/catch never saw rejections — a 401 (most commonly because the caller already revoked the token mid-job) turned into an unhandled promise rejection that crashed the post script and failed the job. Await the call and treat 401 as a successful no-op so the post step is robust against double-revocation.
dsanders11
approved these changes
Apr 24, 2026
dsanders11
approved these changes
Apr 24, 2026
|
🎉 This PR is included in version 2.1.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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.
Adds an optional
permissionsinput so callers can mint installation tokens scoped to a subset of the App's installation permissions rather than always receiving the full scope.The underlying
@electron/github-app-authlibrary already accepts an `AuthNarrowing` argument with apermissionsfield; this plumbs a YAML-parsed input through to it.Example
Levels accepted:
read,write,admin. Invalid shapes / levels / YAML syntax all fail the step with a clear message.Why
For agent-driven workflows and other automation that runs in multiple phases with different needs, it's valuable to mint tightly-scoped tokens per step rather than reusing a full-scope token. If one phase only needs to read, it should have a read-only token; a later phase that writes can mint its own write token. Today the action only exposes the full-scope path.
Implementation notes