Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Pilot Lvl 1
Message 1 of 4

Github secrets fails in single workflow

Solved! Go to Solution.

This action step involving a secret works in one workflow but fails in another:

 

${gh_user} = ("${{ github.repository }}" -Split '/')[0]
docker login -u ${gh_user} -p ${{ secrets.DOCKERHUB_TOKEN }}

 

Results in:

Run ${gh_user} = ("nerdvegas/rez" -Split '/')[0]
flag needs an argument: 'p' in -p
See 'docker login --help'.
##[error]Process completed with exit code 1.

 

The very same workflows worked fine on my local fork of the repo.

 

This works:

https://github.com/nerdvegas/rez/blob/master/.github/workflows/windows-docker-image.yaml#L42

 

This does not:

https://github.com/nerdvegas/rez/blob/master/.github/workflows/windows-docker.yaml#L43

3 Replies
Solution
GitHub Partner
Message 2 of 4

Re: Github secrets fails in single workflow

I checked your two workflow yaml files, and workflow run logs.
There is the step snippet you used in windows-docker.yaml:

 - name: Login to docker repository
      run: |
        ${gh_user} = ("${{ github.repository }}" -Split '/')[0]
        '${{ secrets.DOCKERHUB_TOKEN }}' | docker login -u ${gh_user} --password-stdin

I found ${{ secrets.DOCKERHUB_TOKEN }} was empty which caused Login to docker reposity step fail.

secret logs.png

Can you run windows-docker-image.yaml again, check whether it could succeed? If it also fail, please make sure you still have DOCKERHUB_TOKEN in secrets .

secrets.png

Pilot Lvl 1
Message 3 of 4

Re: Github secrets fails in single workflow

We're not sure what changed on your end but the jobs now magically started to work.

Thanks!

Pilot Lvl 1
Message 4 of 4

Re: Github secrets fails in single workflow

It happened again after a PR here:

https://github.com/nerdvegas/rez/commit/064cd43a69025bae106ce714ebb95107b45a5830/checks?check_suite_...

We did not touch the secret so we are pretty sure that it's a bug in githubs infrastructure.