简体   繁体   中英

GitHub Actions: Referencing environment secrets in reusable workflows

I have been able to pass and reference organization and repository secrets in reusable workflows without any issues. The problem(bug) is that environment specific secrets are not being passed. I've tried being explicit and listing all of them and by using " secrets: inherit ".

If I use " secrets:inherit ", I do not have to list any secrets explicitly. But, the environment secrets are empty when referenced. The results are the same when listing them all out.

There are many forum/blog posts describing how this is supposed to work, but no one ever mentions environment secrets. Declaring the target environment is not allowed in the callers job.

Has anyone found a solution to this issue, or is this know bug in GitHub Actions?

This is known issue. The only way you can make it work is to do a explicitly pass like that: https://github.com/actions/runner/issues/1490#issuecomment-970642607 or https://github.com/orgs/community/discussions/25238#discussioncomment-3247035

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM