ec2-github-runner icon indicating copy to clipboard operation
ec2-github-runner copied to clipboard

incorrect environment on runner, unable to checkout repo

Open davegravy opened this issue 3 years ago • 0 comments

When I try to run actions/checkout without supplying my personal access token (PAT) on my EC2 runner I receive an error: "remote: Repository not found." When I supply my PAT using the token the checkout is successful.

  do-the-job:
    name: Do the job on the runner
    needs: start-runner # required to start the main job when the runner is ready
    runs-on: ${{ needs.start-runner.outputs.label }} # run the job on the newly created runner
    steps:
      - name: clone repo
        uses: actions/checkout@v3
        with:
          token: ${{secrets.GH_PERSONAL_ACCESS_TOKEN}} #without this line it fails

On a Github runner I don't need to supply the token, I think because the action finds it at ${{ github.token }} so my hosted runner must not be receiving this. I inspected the github context on the runner with echo and all looks well except I can't obviously confirm the token (it's censored).

Others seemingly are able to use actions/checkout on their EC2 runner without supplying a token, example: here.

This may be a problem with how I prepared my runner EC2 image however I'm not sure how to diagnose this.

davegravy avatar Oct 02 '22 01:10 davegravy