-
Hi and thanks for the new feature, it was really important to have it as part of GitHub Actions. Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 2 replies
-
Hi, I’m not sure if I can help or not but do you mean passing the name of a secret, or passing the value and treating it as a secret and masking it? For the former, maybe there’s a way you can build an expression to fetch the secret based on the input. I don’t know the exact syntax at the moment. Maybe like:
Again, I don’t know if this exact syntax will work, I am new to workflow coding. Edit: This syntax doesn’t work. Trying other versions For the latter, there’s this https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#masking-a-value-in-log |
Beta Was this translation helpful? Give feedback.
-
Alright I think I got you. Assuming you meant the first interpretation from my other post. I can’t fully test since I can’t seem to run any manual workflows, but I tested this using an env variable. Do this on each step that you need the secret, as apparently you can’t access the “env” context from the workflow-wide “env” block at the top of the file.
or possibly:
|
Beta Was this translation helpful? Give feedback.
-
Hi @gderaco, It’s possible to pass a secret(for example: PAT) as input to the manual workflow. weide-zhou/ticket14Contribute to weide-zhou/ticket14 development by creating an account on GitHub. Note: check the log, the secret value is not protected, could cause data leaking. Thanks. |
Beta Was this translation helpful? Give feedback.
-
Thanks.
|
Beta Was this translation helpful? Give feedback.
-
Does this no longer work?
|
Beta Was this translation helpful? Give feedback.
-
With secrets, it's better if you either explicitly pass them or inherit all of them. |
Beta Was this translation helpful? Give feedback.
Thanks.
This is what worked for me
INJECTED_ENV_VAR: ${{secrets[github.event.inputs.injectedEnvVar]}}