Skip to content

Clarify expiration of created token #128

Closed

Description

@grossag

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?

Activity

  1. grossag commented on Apr 16, 2024

    @grossag
    Author

    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.

  2. gr2m commented on Apr 16, 2024

    @gr2m
    Contributor

    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

  3. changed the title [-]Document expiration time of token and whether that can be customized[/-] [+]Clarify expiration of created token[/+] on Apr 16, 2024
  4. grossag commented on Apr 16, 2024

    @grossag
    Author

    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.

  5. Yang-33 commented on Mar 29, 2025

    @Yang-33
    Contributor

    #141 updated README, so can we close this issue? @grossag @gr2m

  6. grossag commented on Mar 31, 2025

    @grossag
    Author

    Yes, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions