Github Secrets not be found

Recently (today) it looks like Github Secrets aren’t being passed in properly:

Good run: https://github.com/dchbx/enroll-ui/runs/545511347?check_suite_focus=true

env:

STATUS: passing

SHA: 708bdd78670da9d35e260524a1c576f4fccc0596

BRANCH: refs/heads/master

YELLR_KEY: ***

YELLR_URL: ***

NX_CLOUD_AUTH_TOKEN: ***

Bad run: https://github.com/dchbx/enroll-ui/runs/549703106?check_suite_focus=true

env:

STATUS: passing

SHA: 55f69459498064d0af45b48b79def6f28863a75c

BRANCH: refs/heads/master

YELLR_KEY:

YELLR_URL:

NX_CLOUD_AUTH_TOKEN:

2 Likes

I am having the same issue, unfortunately. Some secret values are now blank as of today…

I’m also having this issue. I notice that in your workflow yml file, like in mine, the missing secret is defined in the env section. I have other secrets referenced outside of env (in the jobs section), and those are passed in properly. Weirdly, when I change one of the references to the env variable to directly reference the problematic secret (but keep the other ones still referencing the env variable), everything works. So it seems like Github Actions is looking at the jobs section, checking which secrets are being used, and only passing those in, forgetting to check if they are being used by the env section.

1 Like

@markgoho @kaikue @sagv ,

I also tested using secrets in my workflows, I tried setting secrets as env , and also tried directly using secrets in with section of an action, however everything works fine on my side. I did not reproduce the problem.

I have helped you report this ticket to the appropriate engineering team for further investigation and evaluation. If they have any progress, I will notify you in time, and sometimes the appropriate engineers may directly reply you here.

In addition, please make sure that the secrets you want to use are still exising in the  Secrets list on the Settings tab of your repositories. Make sure nobody have removed or changed them.

If the problem still exists, you can try to remove the secrets then re-add them to the list to see if the problem can be solved.

1 Like

I removed the secrets and re-added them with no success. There’s been no change to our repo, secrets, workflow file, or anything else. It just stopped working between Monday and Tuesday.

BINGO!

I moved the secrets references into the job and they were pulled in perfectly. So, Github Actions has a regression bug. @brightran can you flag this please?

Sorry for the disruption. The behavior will be reverted shortly.

The scenario is the root env in the yaml file references a secret.

Anywhere else in the yaml file that references a secret should work. For example, step-level env. Otherwise let me know if you have another scenario where it was broken.

Should be reverted now. Can you trigger another run and confirm?

It works for me now. Thanks for the fix!

1 Like

@kaikue glad that the problem has gone on your side.

@markgoho @sagv could you please check if it also back to work on your side?

Apologies for the inconvenience caused to you.

Yes, working now. Thanks for investigating and helping to fix this regression.

Secrets don’t appear to work within the windows-latest or windows-2019

I have two workflows on the same repository. One uses ubuntu-latest and the other windows-latest. They should have the same visibility. When I replace the username and password with literal text it works. Secrets are not functional within the windows environment. Please can you help?

  • name: Docker login
    env:
    DockerUserName: ${{ secrets.DockerHubUser }}
    DockerPassword: ${{ secrets.DockerHubPassword }}
    run: |
    echo ‘Docker login’
    set h+

echo “$DockerPassword” | docker login -u “$DockerUserName” --password-stdin index.docker.io

@naj8ryon Windows the “run” step uses powershell by default. Try “$env:DockerPassword” or you can change the shell

1 Like

Brilliant.

The"$env:DockerPassword" approach for getting the variables has worked.

Thank you @ericsciple . I really appreciate your help.