[GitHub Action] How to concatenate a string with a GitHub Actions environment variable? #22548
|
Hi, I would like to ask how to concatenate a string and a GitHub Actions environment variable which is List of GitHub Action environment variables : Environment variables - GitHub Docs This is the file (main.yml) : This is the error I got in GitHub Action : Expected output : Any help is appreciated. |
Replies: 3 comments 1 reply
|
You need to use Actions syntax here. I think |
|
But if one did want to do a concatenation in a shell what is the correct way to do that so that the second argument of And then alternatively what if one wanted to do the same in an if: |
${{ !contains(needs.Import-commit-pragmas.outputs.pr-repos, ${{inputs.NAME}}@) }} |

$GITHUB_SHAis shell syntax, but thetagsargument isn’t a shell. Pretty much the only place in an Actions workflow where you have a shell arerunsteps.You need to use Actions syntax here. I think
${{ github.sha }}is what you want, seegithubcontext.