Github secrets fails in single workflow

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:

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.

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 .

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


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.