Skip to content

Pass a GITHUB_TOKEN from Github actions to AWS Codebuild, in order to update checks from there #101890

Answered by ghost
atirabassi-eb asked this question in Actions
Discussion options

You must be logged in to vote

Integrating GitHub Actions with AWS CodeBuild and attempting to use the GITHUB_TOKEN outside of GitHub Actions is a common challenge. The GITHUB_TOKEN is a short-lived token generated by GitHub Actions and is intended for use within the context of GitHub Actions workflows only. This is likely the reason you're encountering the "Bad credentials" error. The token loses its validity when used outside the Actions environment.

Here’s how you can address this issue:

  1. Using a Personal Access Token (PAT): Instead of relying on GITHUB_TOKEN, you can create a Personal Access Token (PAT) in GitHub with the required scopes (repo, workflow, write:checks, etc.). This token can then be securely passed t…

Replies: 2 comments 1 reply

This comment was marked as off-topic.

@atirabassi-eb
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Actions Build, test, and automate your deployment pipeline with world-class CI/CD Question
2 participants