Skip to content

Commit 032a0dc

Browse files
authored
QL: Merge pull request #132 from github/esbena/fix-branch
change branch name
2 parents f29813b + d49db92 commit 032a0dc

File tree

1 file changed

+32
-1
lines changed

1 file changed

+32
-1
lines changed

.github/workflows/nightly-changes.yml

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
jobs:
99

1010
build:
11-
uses: github/codeql-ql/.github/workflows/build.yml@esbena/workflow-improvements
11+
uses: github/codeql-ql/.github/workflows/build.yml@main
1212
with:
1313
os: '[ "ubuntu-latest" ]'
1414

@@ -98,3 +98,34 @@ jobs:
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+

0 commit comments

Comments
 (0)