Correct me if I’m wrong, but I believe the githubactions:S8263 rule is invalid and should be removed.
GitHub actions are not vulnerable to injection attacks in this manner, because the arguments are passed in as parameters. This is according to official GitHub documentation on how to prevent script injection attacks: Secure use reference - GitHub Docs
The example of the compliant solution, I believe is also not valid. I have not confirmed this, but I have never seen this syntax anywhere in GitHub docs. This part of the workflow is not bash though, so I don’t think it would actually work.
steps:
- name: Example action call
uses: ./helloaction
with:
message: "PR title: $PR_TITLE"
env:
PR_TITLE: ${{ github.event.pull_request.title }}
I think you would have to use the following, which would be subject to same “injection attack” that the rule warns about (though it’s not possible)
```yml
steps:
- name: Example action call
uses: ./helloaction
with:
message: "PR title: ${{ env.PR_TITLE }}"
env:
PR_TITLE: ${{ github.event.pull_request.title }}
There is zero benefit in doing this over using the github context directly in the parameter value.