-
I’m trying to pass in a secrets variable as input to my Github Action and I am getting the following error: “##[error](Line: 7, Col: 18): Unrecognized named-value: ‘secrets’. Located at position 1 within expression: secrets.GALAXY_API_KEY” I’m following this documentation, which has an example showing usage of secrets the same way I am. Example failed job: https://github.com/artis3n/github_version-ansible_plugin/commit/f05d3d777beea879d1fa14d38c416b548635ac35/checks?check_suite_id=276794137 And my secrets panel: |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 1 reply
-
I’m pretty sure this is the problem: https://github.com/artis3n/ansible_galaxy_collection/pull/11/files#diff-689e1a63f106e616debbed3b5aedcb43L8 I am guessing Github Actions tries to interpolate the value in the description string instead of leaving it raw. EDIT: Yeah, this was the problem. This seems like a bug with Github Actions. Or is there a way to reference variables and telling Actions not to interpolate them? Some option to use a literal string? |
Beta Was this translation helpful? Give feedback.
-
@artis3n I’m setting up a workflow template to be used by multiple repos and running into this same issue. In the workflow file deployed to each service, it is pulling in the template repository to run scripts as steps. Using secrets directly in the workflow pulled in the secrets just fine, but trying to reference them from another repository is giving me the error. Were you able to find a solution for this or did you just remove the reference? |
Beta Was this translation helpful? Give feedback.
-
My issue was |
Beta Was this translation helpful? Give feedback.
-
@artis3n I still don’t get it how you resolved. What reference do you mean? I was trying to use the following in the action.
Still getting the error: Unrecognized named-value: ‘secrets’. |
Beta Was this translation helpful? Give feedback.
-
My issue was that I was using the secrets interpolation syntax in a file unrelated to the actions workflow - but GitHub was attempting to interpolate that file anyway. See Fix list on README by artis3n · Pull Request #11 · artis3n/ansible_galaxy_collection · GitHub If you are seeing this, double check whether you have ${{ secrets.* }} anywhere else in your repo or PR. The error might not be inside the action workflow file. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the response. I find that actions.yml cannot fetch the secrets directly. So, I finally fixed it using with in workflow to pass the secret as:
And then, in action.yml,
This helped: GitHub - launchdarkly/find-code-references: Used by the GitHub Marketplace |
Beta Was this translation helpful? Give feedback.
I’m pretty sure this is the problem: https://github.com/artis3n/ansible_galaxy_collection/pull/11/files#diff-689e1a63f106e616debbed3b5aedcb43L8
I am guessing Github Actions tries to interpolate the value in the description string instead of leaving it raw.
EDIT: Yeah, this was the problem. This seems like a bug with Github Actions. Or is there a way to reference variables and telling Actions not to interpolate them? Some option to use a literal string?