actions / create-github-app-token

GitHub Action for creating a GitHub App Installation Access Token
https://github.com/marketplace/actions/create-github-app-token
MIT License
344 stars 47 forks source link

fix(revocation): avoid revoking expired tokens and fail gracefully #95

Closed joshmgross closed 7 months ago

joshmgross commented 7 months ago

Fixes #72

If an Actions job is long enough, more than an hour can pass between creating and revoking the App token in the post-job clean up step. Since the token itself is used to authenticate with the revoke API, an expired token will fail to be revoked.

This PR saves the token expiration in the actions state and uses that in the post step to determine if the token can be revoked. I've also added error handling to the revoke token API call, as it's unlikely that users would want their job to fail if the token can't be revoked.

To Do

create-app-token-action-releaser[bot] commented 7 months ago

:tada: This PR is included in version 1.6.4 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: