-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4bd96d1
commit 8a9f619
Showing
1 changed file
with
23 additions
and
8 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -19,36 +19,51 @@ jobs: | |
go-version: 1.22 | ||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v3 | ||
id: codeql-init | ||
with: | ||
db-location: ./tests/simapp/codeql-db | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
languages: go | ||
source-root: ./tests/simapp | ||
build-mode: manual | ||
packs: skip-mev/cosmos-52-ql | ||
|
||
- name: Build (Make Install) | ||
working-directory: ./tests/simapp | ||
run: | | ||
make install | ||
go build ./connectd/... | ||
- name: Analyze with CodeQL (no upload) | ||
uses: github/codeql-action/analyze@v3 | ||
id: analyze | ||
with: | ||
upload: never | ||
output: ../results | ||
- name: Analyze | ||
working-directory: ./tests/simapp | ||
run: | | ||
echo $PWD | ||
ls $PWD | ||
${{ steps.codeql-init.outputs.codeql-path }} database finalize \ | ||
codeql-db/go | ||
${{ steps.codeql-init.outputs.codeql-path }} database analyze \ | ||
--format=sarif-latest \ | ||
--output=codeql-results.sarif \ | ||
codeql-db/go \ | ||
skip-mev/cosmos-52-ql | ||
- name: Install jq | ||
uses: dcarbone/[email protected] | ||
- name: Annotate code with findings | ||
working-directory: ./tests/simapp | ||
run: | | ||
set -eoux pipefail | ||
cat codeql-results.sarif | ||
issues=$(jq -r ' | ||
.runs[].results[] | | ||
. as $r | | ||
($r.locations[0].physicalLocation.artifactLocation.uri | select(. != null)) as $file | | ||
($r.locations[0].physicalLocation.region.startLine | select(. != null)) as $line | | ||
($r.message.text | gsub("[\r\n]"; " ")) as $msg | | ||
[$file, $line, $msg] | @tsv | ||
' ${{ steps.analyze.outputs.sarif-output }}/go.sarif ) | ||
' codeql-results.sarif ) | ||
while IFS=$'\t' read -r file line msg; do | ||
file="${file#file://}" | ||
|