-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[DO NOT MERGE] Race condition fix for update workflow #9389
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
e793050
fb82558
6e0b11a
8d52ff2
f857103
0ae3626
f9c9b18
9a0e8b9
fbad037
42039c3
6a70894
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -59,29 +59,45 @@ jobs: | |
| echo "single-arch=" >> "$GITHUB_OUTPUT" | ||
| fi | ||
|
|
||
| - name: Compute push parameters | ||
| id: push-params | ||
| run: | | ||
| REF="${{ inputs.ref }}" | ||
| if [[ "$REF" == "spk/update-premature-eos" ]] || [[ "${{ inputs.push }}" == "true" ]]; then | ||
| echo "should-push=true" >> "$GITHUB_OUTPUT" | ||
| else | ||
| echo "should-push=false" >> "$GITHUB_OUTPUT" | ||
| fi | ||
| # Never tag as latest for the branch push | ||
| if [[ "$REF" == "spk/update-premature-eos" ]]; then | ||
| echo "effective-tag-latest=false" >> "$GITHUB_OUTPUT" | ||
| else | ||
| echo "effective-tag-latest=${{ inputs.tag-latest }}" >> "$GITHUB_OUTPUT" | ||
| fi | ||
|
|
||
|
Comment on lines
+64
to
+77
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Semgrep identified a blocking 🔴 issue in your code: To resolve this comment: 🔧 No guidance has been designated for this issue. Fix according to your organization's approved methods. 💬 Ignore this findingReply with Semgrep commands to ignore this finding.
Alternatively, triage in Semgrep AppSec Platform to ignore the finding created by run-shell-injection. You can view more details about this finding in the Semgrep AppSec Platform. |
||
| - name: Build binaries | ||
| uses: ./.github/actions/build-binaries | ||
| with: | ||
| snapshot: ${{ inputs.snapshot }} | ||
| single-arch: ${{ steps.arch-param.outputs.single-arch }} | ||
|
|
||
| - name: Build Docker images | ||
| if: ${{ !inputs.push }} | ||
| if: ${{ steps.push-params.outputs.should-push != 'true' }} | ||
| uses: ./.github/actions/build-docker-images | ||
| with: | ||
| push: false | ||
| tag-latest: ${{ inputs.tag-latest }} | ||
| tag-latest: ${{ steps.push-params.outputs.effective-tag-latest }} | ||
| platform: ${{ inputs.platform }} | ||
| cli-version: ${{ inputs.cli-version }} | ||
| alpine-tag: ${{ inputs.alpine-tag }} | ||
| load: ${{ inputs.platform == 'linux/amd64' || inputs.platform == '' }} | ||
|
|
||
| - name: Build and push Docker images | ||
| if: ${{ inputs.push }} | ||
| if: ${{ steps.push-params.outputs.should-push == 'true' }} | ||
| uses: ./.github/actions/build-docker-images | ||
| with: | ||
| push: true | ||
| tag-latest: ${{ inputs.tag-latest }} | ||
| tag-latest: ${{ steps.push-params.outputs.effective-tag-latest }} | ||
| platform: ${{ inputs.platform }} | ||
| cli-version: ${{ inputs.cli-version }} | ||
| alpine-tag: ${{ inputs.alpine-tag }} | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Semgrep identified a blocking 🔴 issue in your code:
Using variable interpolation
${{...}}withgithubcontext data in arun:step could allow an attacker to inject their own code into the runner. This would allow them to steal secrets and code.githubcontext data can have arbitrary user input and should be treated as untrusted. Instead, use an intermediate environment variable withenv:to store the data and use the environment variable in therun:script. Be sure to use double-quotes the environment variable, like this: "$ENVVAR".To resolve this comment:
🔧 No guidance has been designated for this issue. Fix according to your organization's approved methods.
💬 Ignore this finding
Reply with Semgrep commands to ignore this finding.
/fp <comment>for false positive/ar <comment>for acceptable risk/other <comment>for all other reasonsAlternatively, triage in Semgrep AppSec Platform to ignore the finding created by run-shell-injection.
You can view more details about this finding in the Semgrep AppSec Platform.