Created
April 7, 2023 22:14
-
-
Save pamelafox/3c38ad8354d6965ac7993258298730af to your computer and use it in GitHub Desktop.
Test Github API CodeQL endpoint with sarif upload
This file contains hidden or 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
response=$(gh api \ | |
--method POST \ | |
-H "Accept: application/vnd.github+json" \ | |
-H "X-GitHub-Api-Version: 2022-11-28" \ | |
/repos/pamelafox/pamelafox-site/code-scanning/sarifs \ | |
-f commit_sha='d9b327639e4e84337b9edd297a8cfb098bbfeefa' \ | |
-f ref='refs/heads/a11y' \ | |
-f sarif=$(gzip -c src/tests/axe_results.sarif | base64 -b 0)) | |
url=$(echo $response | grep -o '"url": *"[^"]*"' | cut -d '"' -f 4) | |
# Wait a few seconds for processing to complete | |
gh api \ | |
-H "Accept: application/vnd.github+json" \ | |
-H "X-GitHub-Api-Version: 2022-11-28" \ | |
$url |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment