-
Notifications
You must be signed in to change notification settings - Fork 338
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2463 from github/henrymercer/job-uuid-in-sarif
Add job run UUID to SARIF output
- Loading branch information
Showing
8 changed files
with
138 additions
and
2 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: "Job run UUID added to SARIF" | ||
description: "Tests that the job run UUID is added to the SARIF output" | ||
operatingSystems: ["ubuntu"] | ||
versions: ["nightly-latest"] | ||
steps: | ||
- uses: ./../action/init | ||
id: init | ||
with: | ||
languages: javascript | ||
tools: ${{ steps.prepare-test.outputs.tools-url }} | ||
- uses: ./../action/analyze | ||
with: | ||
output: "${{ runner.temp }}/results" | ||
- name: Upload SARIF | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ matrix.os }}-${{ matrix.version }}.sarif.json | ||
path: "${{ runner.temp }}/results/javascript.sarif" | ||
retention-days: 7 | ||
- name: Check results | ||
shell: bash | ||
run: | | ||
cd "$RUNNER_TEMP/results" | ||
actual=$(jq -r '.runs[0].properties.jobRunUuid' javascript.sarif) | ||
if [[ "$actual" != "$JOB_RUN_UUID" ]]; then | ||
echo "Expected SARIF output to contain job run UUID '$JOB_RUN_UUID', but found '$actual'." | ||
exit 1 | ||
else | ||
echo "Found job run UUID '$actual'." | ||
fi |
This file contains 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
This file contains 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