Skip to content

Commit

Permalink
SARIF
Browse files Browse the repository at this point in the history
  • Loading branch information
justinchuby committed Feb 5, 2023
1 parent 15d72bb commit 222a028
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions .github/workflows/Lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,16 @@ jobs:
echo -e "\e[1m\e[36mYou can reproduce these results locally by using \`lintrunner -m main\`.\e[0m"
exit 1
fi
- name: Store annotations
continue-on-error: true
- name: Produce SARIF
if: always() && matrix.os == 'ubuntu-latest'
run: |
# Use jq to massage the JSON lint output into GitHub Actions workflow commands.
jq --raw-output \
'"::\(if .severity == "advice" or .severity == "disabled" then "warning" else .severity end) file=\(.path),line=\(.line),col=\(.char),title=\(.code) \(.name)::" + (.description | gsub("\\n"; "%0A"))' \
lint.json
python tools/convert_to_sarif.py --input lint.json --output lintrunner.sarif
- name: Upload SARIF file
if: always() && matrix.os == 'ubuntu-latest'
continue-on-error: true
uses: github/codeql-action/upload-sarif@v2
with:
# Path to SARIF file relative to the root of the repository
sarif_file: lintrunner.sarif
category: lintrunner
checkout_path: ${{ github.workspace }}

0 comments on commit 222a028

Please sign in to comment.