From 9232c57ea1d3091b2fa3ba1eced4de0292f0704a Mon Sep 17 00:00:00 2001 From: Adam Cmiel Date: Fri, 19 Jul 2024 12:47:50 +0200 Subject: [PATCH 1/3] test: hardcode rule in sarif output is this why the alert is not disappearing? --- .github/workflows/checkton-self.yaml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/.github/workflows/checkton-self.yaml b/.github/workflows/checkton-self.yaml index 9b7a51e..7eacb33 100644 --- a/.github/workflows/checkton-self.yaml +++ b/.github/workflows/checkton-self.yaml @@ -28,6 +28,31 @@ jobs: differential: false fail-on-findings: false + - name: Inject rules into the SARIF file + run: | + jq < .checkton.sarif '.runs[].tool.driver.rules = [ + { + "id": "SHELLCHECK_WARNING: warning[SC2053]", + "properties": { + "tags": [ + "ShellCheck" + ] + }, + "name": "SC2053", + "shortDescription": { + "text": "SC2053" + }, + "help": { + "text": "Defect reference: https://github.com/koalaman/shellcheck/wiki/SC2053", + "markdown": "Defect reference: [SC2053](https://github.com/koalaman/shellcheck/wiki/SC2053)" + }, + "fullDescription": { + "text": "Defect reference: https://github.com/koalaman/shellcheck/wiki/SC2053" + } + } + ]' > .checkton.sarif.2 + mv .checkton.sarif.2 .checkton.sarif + - name: Upload SARIF file uses: github/codeql-action/upload-sarif@4fa2a7953630fd2f3fb380f21be14ede0169dd4f # v3 with: From b64fcd548a74512728590c9561fdc91a0963dc1e Mon Sep 17 00:00:00 2001 From: Adam Cmiel Date: Fri, 19 Jul 2024 10:54:48 +0200 Subject: [PATCH 2/3] test: introduce warning Signed-off-by: Adam Cmiel --- .github/workflows/release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index d007147..a2dd3fd 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -25,7 +25,7 @@ jobs: image_without_digest=${image%@*} version=${image_without_digest##*:} - if [[ "$tag" != "$version" ]]; then + if [[ $tag != $version ]]; then echo "Tag does not match action.yaml image version: $tag X $image" >&2 exit 1 fi From b3fcae2513116f5a15bd33c32116455dfb8a362c Mon Sep 17 00:00:00 2001 From: Adam Cmiel Date: Fri, 19 Jul 2024 12:55:09 +0200 Subject: [PATCH 3/3] test: fix warning Signed-off-by: Adam Cmiel --- .github/workflows/release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index a2dd3fd..7dde7cb 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -25,7 +25,7 @@ jobs: image_without_digest=${image%@*} version=${image_without_digest##*:} - if [[ $tag != $version ]]; then + if [[ $tag != "$version" ]]; then echo "Tag does not match action.yaml image version: $tag X $image" >&2 exit 1 fi