Skip to content

Commit 3aa8de3

Browse files
authored
Create codescan.yml
1 parent 84907ab commit 3aa8de3

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

.github/workflows/codescan.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
6+
# This workflow requires that you have an existing account with codescan.io
7+
# For more information about configuring your workflow,
8+
# read our documentation at https://github.com/codescan-io/codescan-scanner-action
9+
name: CodeScan
10+
11+
on:
12+
push:
13+
branches: [ "main" ]
14+
pull_request:
15+
# The branches below must be a subset of the branches above
16+
branches: [ "main" ]
17+
schedule:
18+
- cron: '44 4 * * 2'
19+
20+
permissions:
21+
contents: read
22+
23+
jobs:
24+
CodeScan:
25+
permissions:
26+
contents: read # for actions/checkout to fetch code
27+
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
28+
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: Checkout repository
32+
uses: actions/checkout@v4
33+
- name: Cache files
34+
uses: actions/cache@v3
35+
with:
36+
path: |
37+
~/.sonar
38+
key: ${{ runner.os }}-sonar
39+
restore-keys: ${{ runner.os }}-sonar
40+
- name: Run Analysis
41+
uses: codescan-io/codescan-scanner-action@5b2e8c5683ef6a5adc8fa3b7950bb07debccce12
42+
with:
43+
login: ${{ secrets.CODESCAN_AUTH_TOKEN }}
44+
organization: ${{ secrets.CODESCAN_ORGANIZATION_KEY }}
45+
projectKey: ${{ secrets.CODESCAN_PROJECT_KEY }}
46+
- name: Upload SARIF file
47+
uses: github/codeql-action/upload-sarif@v3
48+
with:
49+
sarif_file: codescan.sarif

0 commit comments

Comments
 (0)