Showing results for 
Search instead for 
Did you mean: 
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:


This does not:

3 Replies
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 .


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.


Pilot Lvl 1
Message 4 of 4

Re: Github secrets fails in single workflow

It happened again after a PR here:

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