File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change 9898
9999 - name : Perform CodeQL Analysis
100100 uses : github/codeql-action/analyze@esbena/ql
101+ with :
102+ upload : false
103+ output : ${{ runner.temp }}/sarifs
104+ add-snippets : true
105+
106+ - name : Upload results artifact
107+ uses : actions/upload-artifact@v2
108+ with :
109+ name : results
110+ path : ${{ runner.temp }}/sarifs
111+
112+ - name : Obtain git info for sarif upload
113+ id : git-info
114+ run : |
115+ echo "::set-output name=commit_sha::$(git log -1 --format=%H | tr -d '\n')"
116+ echo "::set-output name=ref::refs/heads/nightly-changes-alerts"
117+
118+ - name : Upload results to code-scanning
119+ run : |
120+ URL="https://api.github.com/repos/github/codeql-ql/code-scanning/sarifs"
121+ ENCODED_SARIF_FILE=ql.sarif.encoded
122+ gzip -c "${SARIFS}/ql.sarif" | base64 -w0 > "${ENCODED_SARIF_FILE}"
123+ ARGS_FILE=args.json
124+ jq -nc --arg commit_sha "${COMMIT_SHA}" --arg ref "${REF}" --rawfile sarif "${ENCODED_SARIF_FILE}" '.commit_sha=$commit_sha | .ref=$ref | .sarif=$sarif' > "${ARGS_FILE}"
125+ curl -H "Authorization: token ${GITHUB_TOKEN}" -H "Accept: application/vnd.github.v3+json" "${URL}" -d "@${ARGS_FILE}"
126+ env :
127+ COMMIT_SHA : ${{ steps.git-info.outputs.commit_sha }}
128+ REF : ${{ steps.git-info.outputs.ref }}
129+ SARIFS : ${{ runner.temp }}/sarifs
130+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
131+
You can’t perform that action at this time.
0 commit comments