Skip to content

Commit 3a02572

Browse files
author
Shadi Samadi
committed
updated readme
1 parent fe88535 commit 3a02572

File tree

1 file changed

+46
-22
lines changed

1 file changed

+46
-22
lines changed

README.md

Lines changed: 46 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,60 +17,84 @@ CodeQL populates the `suppression` property in its SARIF output based on the res
1717
### Example - CodeQL
1818

1919
```yaml
20-
name: "CodeQL"
20+
name: "CodeQL Advanced"
2121

2222
on:
2323
push:
24-
branches: [ main ]
24+
branches: [main]
2525
pull_request:
26-
branches: [ main ]
27-
26+
branches: [main]
27+
schedule:
28+
- cron: "31 7 * * 3"
2829
jobs:
2930
analyze:
30-
name: Analyze
31-
runs-on: ubuntu-latest
31+
name: Analyze (${{ matrix.language }})
32+
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
3233
permissions:
34+
security-events: write
35+
packages: read
3336
actions: read
3437
contents: read
35-
security-events: write
3638

3739
strategy:
3840
fail-fast: false
3941
matrix:
40-
language: [ "java" ]
42+
include:
43+
- language: go
44+
build-mode: autobuild
45+
- language: java-kotlin
46+
build-mode: none
47+
- language: javascript-typescript
48+
build-mode: none
49+
- language: python
50+
build-mode: none
4151

4252
steps:
4353
- name: Checkout repository
44-
uses: actions/checkout@v3
54+
uses: actions/checkout@v4
55+
56+
- name: Map Languages
57+
run: |
58+
if [ "${{ matrix.language }}" == "java-kotlin" ]; then
59+
echo "language=java" >> $GITHUB_ENV
60+
elif [ "${{ matrix.language }}" == "javascript-typescript" ]; then
61+
echo "language=javascript" >> $GITHUB_ENV
62+
else
63+
echo "language=${{ matrix.language }}" >> $GITHUB_ENV
64+
fi
4565
4666
- name: Initialize CodeQL
47-
uses: github/codeql-action/init@v2
67+
uses: github/codeql-action/init@v3
4868
with:
4969
languages: ${{ matrix.language }}
50-
# run an 'alert-suppression' query
51-
packs: "codeql/${{ matrix.language }}-queries:AlertSuppression.ql"
52-
53-
- name: Autobuild
54-
uses: github/codeql-action/autobuild@v2
70+
build-mode: ${{ matrix.build-mode }}
71+
packs: "codeql/${{ env.language }}-queries:AlertSuppression.ql"
72+
73+
- if: matrix.build-mode == 'manual'
74+
shell: bash
75+
run: |
76+
echo 'If you are using a "manual" build mode for one or more of the' \
77+
'languages you are analyzing, replace this with the commands to build' \
78+
'your code, for example:'
79+
echo ' make bootstrap'
80+
echo ' make release'
81+
exit 1
5582
5683
- name: Perform CodeQL Analysis
57-
# define an 'id' for the analysis step
5884
id: analyze
5985
uses: github/codeql-action/analyze@v2
6086
with:
6187
category: "/language:${{matrix.language}}"
62-
# define the output folder for SARIF files
6388
output: sarif-results
64-
89+
6590
- name: Dismiss alerts
6691
if: github.ref == 'refs/heads/main'
67-
uses: advanced-security/dismiss-alerts@v1
92+
uses: s-samadi/dismiss-alerts@main
6893
with:
69-
# specify a 'sarif-id' and 'sarif-file'
7094
sarif-id: ${{ steps.analyze.outputs.sarif-id }}
71-
sarif-file: sarif-results/${{ matrix.language }}.sarif
95+
sarif-file: sarif-results/${{ env.language }}.sarif
7296
env:
73-
GITHUB_TOKEN: ${{ github.token }}
97+
GITHUB_TOKEN: ${{ github.token }
7498
```
7599
76100
### Third party produced SARIF file

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy