-
Notifications
You must be signed in to change notification settings - Fork 59
Create codeql.yml workflow #314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
413ba8e
Create codeql.yml
w0rmr1d3r c42b08c
closing file to solve warning issue
w0rmr1d3r 9dd80a7
closing file to solve warning issue
w0rmr1d3r 5ec6acd
fix `Note` for better readability
w0rmr1d3r 2e28250
update cron schedule
w0rmr1d3r 5c9daa0
Merge branch 'master' into enable-codeql
w0rmr1d3r 09c101d
update CHANGELOG.md
w0rmr1d3r 9cf2b99
Merge branch 'master' into enable-codeql
jsoucheiron a95fd13
Merge branch 'master' into enable-codeql
jsoucheiron 287702f
PR suggestions - reduce file descriptor
w0rmr1d3r File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
name: "CodeQL" | ||
|
||
on: | ||
push: | ||
branches: [ "master" ] | ||
pull_request: | ||
branches: [ "master" ] | ||
schedule: | ||
- cron: "00 7 * * 1" # “At 07:00 on Monday.” | ||
|
||
jobs: | ||
analyze: | ||
name: Analyze | ||
runs-on: ubuntu-latest | ||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
language: [ python ] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- uses: actions/create-github-app-token@v1 | ||
id: app-token | ||
with: | ||
app-id: ${{ vars.GH_APP_ID }} | ||
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }} | ||
|
||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v3 | ||
with: | ||
languages: ${{ matrix.language }} | ||
queries: +security-and-quality | ||
token: ${{ steps.app-token.outputs.token }} | ||
|
||
- name: Autobuild | ||
uses: github/codeql-action/autobuild@v3 | ||
with: | ||
token: ${{ steps.app-token.outputs.token }} | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v3 | ||
with: | ||
category: "/language:${{ matrix.language }}" | ||
token: ${{ steps.app-token.outputs.token }} | ||
upload: never | ||
|
||
# Workaround for parallel GitHub bugs | ||
# * Can't use GHA token with IP allowlisting | ||
# https://docs.github.com/en/enterprise-cloud@latest/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/managing-allowed-ip-addresses-for-your-organization#using-github-actions-with-an-ip-allow-list | ||
# * Can't use codeql-action/analyze with custom token | ||
# https://support.github.com/ticket/enterprise/3427/3214517 | ||
- name: Prepare for CodeQL Upload | ||
run: | | ||
echo '{"commit_sha": "${{ github.sha }}", "ref": "${{ github.ref }}"}' > ./codeql-upload.json | ||
|
||
- name: Gzip CodeQL SARIF Result | ||
run: | | ||
gzip -c ../results/${{ matrix.language }}.sarif | base64 -w0 > codeql-results.sarif.gz.base64 | ||
|
||
- name: Staple SARIF result to CodeQL upload | ||
run: | | ||
jq --rawfile sarif codeql-results.sarif.gz.base64 '.sarif = $sarif' codeql-upload.json > codeql-upload-with-sarif.json | ||
|
||
- name: Upload CodeQL Results | ||
run: | | ||
curl --fail-with-body \ | ||
-X POST \ | ||
-H "Authorization: token ${{ steps.app-token.outputs.token }}" \ | ||
-H "Accept: application/vnd.github.v3+json" \ | ||
--data "@codeql-upload-with-sarif.json" \ | ||
https://api.github.com/repos/${{ github.repository }}/code-scanning/sarifs |
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
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
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
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.