- Newest
- Most votes
- Most comments
The issue with your GitHub Actions self-hosted runner on CodeBuild not spinning up appears to be related to authentication problems. Based on the error message, there are a few potential root causes:
- Insufficient Permissions: While you've added several permissions to your Personal Access Token (PAT), you might be missing some required permissions. For GitHub Actions integration with CodeBuild, ensure your PAT has:
- Read permissions for deployments and actions within GitHub
- Appropriate access to the organization repositories
-
Project Name Mismatch: If the project name in your GitHub Actions workflow YAML doesn't exactly match the name of the CodeBuild project you created, CodeBuild won't process the webhook and the GitHub Actions workflow might hang.
-
Authentication Token Issues: Your PAT might not be properly configured or recognized. Since you're using an organization repository, ensure that:
- The PAT is still valid and not expired
- The GitHub user associated with the PAT has not been removed from the organization
To fix these issues:
-
Verify that your CodeBuild project name exactly matches what's referenced in your GitHub Actions workflow YAML.
-
Check if your PAT has all necessary permissions, particularly read permissions for deployments and actions.
-
Ensure the GitHub user associated with the PAT is still part of the organization and has appropriate access.
-
Consider using an alternative authentication method like OAuth or CodeConnections if PAT continues to cause issues.
-
Use the GitHub API to debug webhook deliveries to see exactly what's happening when the webhook is triggered.
If you're hitting API rate limits as suggested in the error message, you may need to wait before trying again or optimize your setup to reduce API calls.
Sources
Self-hosted GitHub Actions runners in AWS CodeBuild - AWS CodeBuild
Troubleshoot the webhook - AWS CodeBuild
Tutorial: Configure a CodeBuild-hosted GitHub Actions runner - AWS CodeBuild
Resolve authentication errors during CodeBuild GitHub Actions integration | AWS re:Post
answered 9 months ago
Hi Hikouki,
Your fine‑grained PAT does not include all permissions required for CodeBuild to create the webhook. CodeBuild creates GitHub webhooks via the GitHub App/Connection, and this operation requires broader permissions than a fine‑grained PAT provides.
Fine‑grained PATs cannot grant Actions or Deployments permissions, which are required for CodeBuild’s webhook creation.
Additionally, PATs lack the ability to act at the organization admin level, which is needed to create repo-level webhooks for org-owned private repos.
AWS official guidance and multiple blogs emphasize that using a PAT for CodeBuild GitHub Actions runners is not recommended; you should instead use OAuth / GitHub App connection.
Ref: https://sjramblings.io/github-self-hosted-runners-on-aws-codebuild/
answered 9 months ago
Hi @Chandramouli, thanks for your response.
From this article, https://www.wiz.io/blog/wiz-research-codebreach-vulnerability-aws-codebuild. Seems PAT is recommended.
I want to try with PAT first. Then which permission I need to add? I added Actions and Deployment read-only to repositories scope but I don't work.
answered 9 months ago
