pantheon-systems / circleci-orb

Use CircleCI to push code to Pantheon Dev and Multidev Environments
10 stars 18 forks source link

Could not determine authentication token for GitHub serivces. Please set GITHUB_TOKEN #47

Closed maskedjellybean closed 4 years ago

maskedjellybean commented 4 years ago

I've followed the readme: https://github.com/pantheon-systems/circleci-orb

Yesterday pipeline builds were completing successfully. Today they are failing at the "Delete old Multidevs to make space for a potential new one" step with this error:

terminus -n build:env:delete:ci "$TERMINUS_SITE" --keep=2 --yes

 [notice] Rsync ci-34.41bb5bb9-3ef0-4449-b837-8f30bd6b5e17@appserver.ci-34.41bb5bb9-3ef0-4449-b837-8f30bd6b5e17.drush.in:code/build-metadata.json => /tmp/build-metadata.json

 [notice] Rsync ci-44.41bb5bb9-3ef0-4449-b837-8f30bd6b5e17@appserver.ci-44.41bb5bb9-3ef0-4449-b837-8f30bd6b5e17.drush.in:code/build-metadata.json => /tmp/build-metadata.json

 [error]  Could not determine authentication token for GitHub serivces. Please set GITHUB_TOKEN 

Exited with code exit status 1 
CircleCI received exit code 1 

The readme does not mention the GITHUB_TOKEN variable. I'm not sure how to interpret Github's documentation on it or where I would add this variable for a CircleCI integration. https://docs.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token

maskedjellybean commented 4 years ago

I believe yesterday's builds were successful because I had not yet reached whatever the limit is on Multidev environments. It's a strange error if that is the cause. CircleCI has no problem running all the previous steps that would require a connection to Github.

stevector commented 4 years ago

Hi @maskedjellybean, thanks for the bug report.

That variable should be a personal access token from GitHub: https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token

You would set it in the same CircleCI env var configuration screen where you set TERMINUS_SITE.

I'm surprised you're the first to report this bug since it is an oversight to not have it in the docs. What version of the Orb are you using? The recent 0.5.0 release changed where terminus -n build:env:delete:ci gets called but it shouldn't have changed whether it is called (and whether an error is thrown when GITHUB_TOKEN is absent)

maskedjellybean commented 4 years ago

Hi @stevector , I'm not sure exactly how to see what version of the Orb I'm using. This is what my config.yml looks like:

version: 2.1
workflows:
  version: 2
  pantheon_push:
    jobs:
      - pantheon/push:
          post-steps:
            - run:
                name: Reset Development Mode
                command: terminus connection:set ${TERMINUS_SITE}.${TERMINUS_ENV} git

orbs:
  pantheon: pantheon-systems/pantheon@0.2.0

I'll look into adding the access token. Thanks!

maskedjellybean commented 4 years ago

Creating a new Github access token and setting the env var in CircleCI worked. Thanks for your work on this! This is going to make our process so much smoother.