Debian Codegraph @

automation/eclair_analysis/ECLAIR/action_upload_sarif.sh

raw symbols SCIP
1 #!/bin/shscip-shell filesystem . . `/bin/sh`.
2
3 set -eu
4
5 usagescip-shell shell xen 4.20.2+37-g61ff35323e-1 usage().() {
6 echoscip-shell system . . echo. "Usage: $0 SARIF_FILE" >&2
7 exit 2
8 }
9
10 [scip-shell system . . `[`. $# -eq 1 ] || usagescip-shell shell xen 4.20.2+37-g61ff35323e-1 usage().
11
12 HERE=$( (
13 cd "$(dirnamescip-shell system . . dirname. "$0")"
14 echoscip-shell system . . echo. "${PWD}"
15 ))
16
17 . "${HERE}/action.helpers"
18
19 sarifFile=$1
20 sarifPayload=${HERE}/sarif.gz.b64
21 uploadLog=${HERE}/upload_sarif.log
22
23 gzipscip-shell system . . gzip. -c "${sarifFile}" | base64scip-shell system . . base64. -w0 >"${sarifPayload}"
24
25 ex=0
26 gh api --method POST -H "Accept: application/vnd.github+json" \
27 "/repos/${GITHUB_REPOSITORY}/code-scanning/sarifs" \
28 -f "commit_sha=${GITHUB_SHA}" -f "ref=${GITHUB_REF}" \
29 -F "sarif=@${sarifPayload}" \
30 --silent >"${uploadLog}" 2>&1 || ex=$?
31 maybe_log_file_exit ADD_COMMENT "Uploading SARIF" "${uploadLog}" "${ex}"