question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can not use secrets in composite jobs

See original GitHub issue

Describe the bug A clear and concise description of what the bug is. I have tried using the following documentation to pass a secret from a workflow to the composite job: documentation I am trying to call a composite job specified in action.yaml (existing in 1 repo), and the caller (a workflow file in a separate repo).

To Reproduce Steps to reproduce the behavior: See my gist here: link to gist Put the 2 files in separate repos. Try to pass a variable from the workflow files repo to the composite job.

Expected behavior That it would not fail with an error and display the value of the passed secret. ( I understand that it could be masked in output log)

Runner Version and Platform

Version of your runner? I am using the github-hosted runner, so I assume it is the most current version.

OS of the machine running the runner? OSX/Windows/Linux/… Linux

What’s not working?

Please include error messages and screenshots. This ends up giving me the following error: Error: /home/runner/work/my-repo/my-repo/./.github/actions/my-action/action.yml: Error: /home/runner/work/my-repo/my-repo/./.github/actions/my-action/action.yml: (Line: 12, Col: 54, Idx: 253) - (Line: 12, Col: 54, Idx: 253): Mapping values are not allowed in this context. Error: System.ArgumentException: Unexpected type '' encountered while reading 'action manifest root'. The type 'MappingToken' was expected. at GitHub.DistributedTask.ObjectTemplating.Tokens.TemplateTokenExtensions.AssertMapping(TemplateToken value, String objectDescription) at GitHub.Runner.Worker.ActionManifestManager.Load(IExecutionContext executionContext, String manifestFile) Error: Fail to load /home/runner/work/my-repo/my-repo/./.github/actions/my-action/action.yml

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
minaf1commented, Aug 26, 2021

interesting, I found the issue with my setup. I had this for the echo command in my composite job: run: echo "use secret: ${{ inputs.secret }}" I believe the colon in the command was being interpreted as a mapping, giving me the error. Thank you for the help guys, this feature is going to help immensely.

0reactions
fearphagecommented, Aug 25, 2021

Perhaps the issue is because the 2 files are in different repositories

It has nothing to do with the number of repos. Here I am using @thboop’s action from my repo.

https://github.com/fearphage/simple-actions-demo

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using Secrets in Composite Actions GitHub
I am creating a composite action and I am trying to use the secrets supplied by GitHub but I am running into errors...
Read more >
Unable to use GitHub Secret with Composite action #1557
Describe the bug I'm trying to pass the secrets to a script run from composite action. But instead of passing actual value, it...
Read more >
Composite Actions cannot use secrets, not from the ...
In Actions, a "secret" is always masked using *** even if you try to print it out. If you pass it as a...
Read more >
Is there any way to use a secret from my github composite ...
No, you can't have a secret defined in your composite action repo that is used. You'd have to use an organization secret and...
Read more >
Composite Actions vs Reusable Workflows
Composite Actions cannot use secrets, not from the workflow nor as parameter. And this, as you can imagine, could be a fairly big...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found