Repository navigation
security: ci: read the issue body from the environment - #1
Open
Shengcun-Scanner wants to merge 1 commit into
Open
Shengcun-Scanner wants to merge 1 commit into
Shengcun-Scanner wants to merge 1 commit into
Conversation
The labelling steps put the issue body inside a here-string, so a body containing a quote could run commands in a job that holds a personal access token. Read the body from env instead. Co-Authored-By: Shengcun <business@rs-systems-web.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
greet.ymllabels new issues by looking for campaign tags in the body, and it feedsthe body to
grepthrough a here-string:The same shape repeats for
GSSoC23,hacktoberfestandIWOC2024. The runnersubstitutes the text before bash parses the step, so a body containing
"ends thehere-string argument and the rest of the body is executed inside the workflow runner.
The personal access token is in
with:on the latergithub-scriptsteps rather thanin this step's environment, so the shell is not how it is reached; the runner is.
Fix
Set the body once at job level and use it as a variable:
The four
greptests, theset-outputresults and the labelling steps are otherwiseuntouched.
Verification
yaml.safe_loadparses the workflow; the trigger, the comment step and bothgithub-scriptsteps are unchanged.