reviewdog/action-staticcheck

Error pulling private repos

jdpedrie opened this issue · 0 comments

I'm trying to setup this action in a golang project that uses private github repos. I've had success in other cases adding a step to the build to configure authentication using an auth token, but this doesn't seem to work with this action.

name: reviewdog
on: [pull_request]
jobs:
  staticcheck:
    name: runner / staticcheck
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Configure git for private modules
        env:
          TOKEN: ${{ secrets.USER_TOKEN }}
        run: git config --global url."https://my-github-user:${TOKEN}@github.com".insteadOf "https://github.com"
      - uses: reviewdog/action-staticcheck@v1
        with:
          github_token: ${{ secrets.github_token }}
          reporter: github-pr-review
          filter_mode: nofilter
          fail_on_error: true

I've tried setting GIT_TERMINAL_PROMPT=1 in the staticcheck environment and using my token as the github token for staticcheck, both with no success.

The error is as follows, with specific information removed:

err: exit status 1: stderr: go: github.com/Organization/repository@versionref: invalid version: git fetch -f origin refs/heads/*:refs/heads/* refs/tags/*:refs/tags/* in /go/pkg/mod/cache/vcs/daca67f07b1fc0438808c512647cb396744c1640c17a52da47f378d3533b2fb5: exit status 128:
	fatal: could not read Username for 'github.com': No such device or address

Thanks for any help!