Unable to create GitHub Repository using Terraform

Hello Team,

I’m seeking assistance with a challenge we’re facing while creating a new repository using Terraform. The error message we’re encountering is:

Error: GET https://api.github.com/repos/***/***/pages: 403 Resource not accessible by integration

I’ve added the necessary GitHub secrets in the action and attempted to print the secrets to ensure they are being correctly referenced.

However, upon committing the code and inspecting the Terraform Actions, I observe that the GitHub Token value is empty. It’s unclear why the value is not being retrieved from the secrets.

The GitHub Token is defined as GITHUB_TOKEN. Any guidance on how to address this issue and properly pass the token to resolve the 403 error would be greatly appreciated.

Thank you.

Prasad Veerangan

Hi @prasadveerangan, the GitHub token
‘ GITHUB_TOKEN’ is only scoped to the repository you’re running the git action from. If you’re using terraform to create a new repository using that same token, it won’t work. I’ll suggest you create a personal access token ‘PAT’ for this purpose.