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:

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

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.

Thanks!

It happened again after a PR here:

https://github.com/nerdvegas/rez/commit/064cd43a69025bae106ce714ebb95107b45a5830/checks?check_suite_id=302811678

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