Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify expiration of created token #128

Open
grossag opened this issue Apr 16, 2024 · 3 comments
Open

Clarify expiration of created token #128

grossag opened this issue Apr 16, 2024 · 3 comments

Comments

@grossag
Copy link

grossag commented Apr 16, 2024

Sorry if this is already covered.

How long is a token created by create-github-app-token expected to last? It appears that it only lasts 1 hour so our longer Conan builds start failing to fetch repositories after 1 hour.

Is this customizable?

@grossag
Copy link
Author

grossag commented Apr 16, 2024

Actually I may have found my answer. https://docs.github.com/en/enterprise-cloud@latest/rest/apps/apps?apiVersion=2022-11-28#create-an-installation-access-token-for-an-app says:

Installation tokens expire one hour from the time you create them. Using an expired token produces a status code of 401 - Unauthorized, and requires creating a new installation token.

which shows that this can't be customized or refreshed.

@gr2m
Copy link
Contributor

gr2m commented Apr 16, 2024

Yes your findings are correct, the token expires after one hour, the time cannot be extended.

I wonder what the best place would be to document that, you are not the first to ask about it.
We could also add a log message 🤔 I'm open to suggestions

@gr2m gr2m changed the title Document expiration time of token and whether that can be customized Clarify expiration of created token Apr 16, 2024
@grossag
Copy link
Author

grossag commented Apr 16, 2024

I would recommend adding it either as a subsection of the "How it Works" section or in a newer "Token Expiration" or "Notes" section at the end.

Here's my best shot at a wording:

This action generates an API token that lasts for 1 hour and cannot be renewed. For more information on this limitation, you can refer to the documentation for the underlying GitHub API that this action uses. Using this token after expiration will result in a 401 - Unauthorized error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants