Troubleshoot GitHub token issues - Amazon CodeDeploy
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Troubleshoot GitHub token issues

Invalid GitHub OAuth token

CodeDeploy applications created after June 2017 use GitHub OAuth tokens for each Amazon Region. The use of tokens tied to specific Amazon Regions gives you more control over which CodeDeploy applications have access to a GitHub repository.

If you receive a GitHub token error, you might have an older token that is now invalid.

To fix an invalid GitHub OAuth token

  1. Remove the old token using one of the following methods:

    • To remove the old token using the API, use DeleteGitHubAccountToken.

    • To remove the old token using the Amazon Command Line Interface:

      1. Go to the computer where the token resides.

      2. Make sure the Amazon CLI is installed on this computer. For installation instructions, see Installing, updating, and uninstalling the Amazon CLI in the Amazon Command Line Interface User Guide

      3. Enter the following command on the computer where the token resides:

        aws delete-git-hub-account-token

        For details on the command syntax, see delete-git-hub-account-token.

  2. Add a new OAuth token. For more information, see Integrating CodeDeploy with GitHub.

Maximum number of GitHub OAuth tokens exceeded

When you create a CodeDeploy deployment, the maximum number of allowed GitHub tokens is 10. If you receive an error about GitHub OAuth tokens, make sure you have 10 or fewer tokens. If you have more than 10 tokens, the first tokens that were created are invalid. For example, if you have 11 tokens, the first token you created is invalid. If you have 12 tokens, the first two tokens you created are invalid. For information about using the CodeDeploy API to remove old tokens, see DeleteGitHubAccountToken.