Skip to content

Conversation

@jamesnetherton
Copy link
Contributor

No description provided.

Comment on lines -131 to +132
echo ${{ github.head_ref }} > ./dependabot-pr/BRANCH_REF
echo ${{ github.event.pull_request.head.sha }} > ./dependabot-pr/PR_HEAD_SHA
printf '%s\n' "${{ github.head_ref }}" > ./dependabot-pr/BRANCH_REF
printf '%s\n' "${{ github.event.pull_request.head.sha }}" > ./dependabot-pr/PR_HEAD_SHA
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this supposed to be a protection against some sort of an attack? Why is printf more safe than echo?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought maybe to guard against being able to sneak in \ sequences that could potentially alter the output. But now that I think about it more. I don't think head_ref or sha are vulnerable to such things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants