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
feat: Add a skip_token_revoke input for configuring token revocation (actions#54)
Fixesactions#55
Currently, `actions/create-github-app-token` always/unconditionally
revokes the installation access token in a `post` step, at the
completion of the current job. This prevents tokens from being used in
other jobs.
This PR makes this behavior configurable:
- When the `skip-token-revoke` input is not specified (i.e. by default),
the token is revoked in a `post` step (i.e. the current behavior).
- When the `skip-token-revoke` input is set to a truthy value (e.g.
`"true"`[^1]), the token is not revoked in a `post` step.
This PR adds a test for the `skip-token-revoke: "true"` case.
This is configurable in other app token actions, e.g.
[tibdex/github-app-token](https://github.com/tibdex/github-app-token/blob/3eb77c7243b85c65e84acfa93fdbac02fb6bd532/README.md?plain=1#L46-L47)
and
[wow-actions/use-app-token](https://github.com/wow-actions/use-app-token/blob/cd772994fc762f99cf291f308797341327a49b0c/README.md?plain=1#L132).
[^1]: Note that `"false"` is also truthy: `Boolean("false")` is `true`.
If we think that’ll potentially confuse folks, I can require
`skip-token-revoke` to be set explicitly to `"true"`.
Copy file name to clipboardExpand all lines: README.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -145,6 +145,10 @@ jobs:
145
145
> [!NOTE]
146
146
> If `owner` is set and `repositories` is empty, access will be scoped to all repositories in the provided repository owner's installation. If `owner` and `repositories` are empty, access will be scoped to only the current repository.
147
147
148
+
### `skip_token_revoke`
149
+
150
+
**Optional:** If truthy, the token will not be revoked when the current job is complete.
151
+
148
152
## Outputs
149
153
150
154
### `token`
@@ -158,7 +162,7 @@ The action creates an installation access token using [the `POST /app/installati
158
162
1. The token is scoped to the current repository or `repositories` if set.
159
163
2. The token inherits all the installation's permissions.
160
164
3. The token is set as output `token` which can be used in subsequent steps.
161
-
4. The token is revoked in the `post` step of the action, which means it cannot be passed to another job.
165
+
4. Unless the `skip_token_revoke` input is set to a truthy value, the token is revoked in the `post` step of the action, which means it cannot be passed to another job.
162
166
5. The token is masked, it cannot be logged accidentally.
0 commit comments