Skip to content

Commit b615bfa

Browse files
authored
[PM-16208] chore(ci): Split scan workflow for protected branches and migrate to new sonarqube action (#4489)
1 parent f6bd467 commit b615bfa

File tree

2 files changed

+62
-8
lines changed

2 files changed

+62
-8
lines changed

.github/workflows/scan-ci.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Scan Protected Branches On Push
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- "main"
8+
9+
jobs:
10+
sast:
11+
name: SAST scan
12+
runs-on: ubuntu-24.04
13+
permissions:
14+
contents: read
15+
security-events: write
16+
17+
steps:
18+
- name: Check out repo
19+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
20+
with:
21+
fetch-depth: 0
22+
23+
- name: Scan with Checkmarx
24+
uses: checkmarx/ast-github-action@b74e8d514feae4ad5ad2b43e72590935bd2daf5f # 2.0.39
25+
with:
26+
project_name: ${{ github.repository }}
27+
cx_tenant: ${{ secrets.CHECKMARX_TENANT }}
28+
base_uri: https://ast.checkmarx.net/
29+
cx_client_id: ${{ secrets.CHECKMARX_CLIENT_ID }}
30+
cx_client_secret: ${{ secrets.CHECKMARX_SECRET }}
31+
additional_params: |
32+
--report-format sarif \
33+
--filter "state=TO_VERIFY;PROPOSED_NOT_EXPLOITABLE;CONFIRMED;URGENT" \
34+
--output-path .
35+
36+
- name: Upload Checkmarx results to GitHub
37+
uses: github/codeql-action/upload-sarif@aa578102511db1f4524ed59b8cc2bae4f6e88195 # v3.27.6
38+
with:
39+
sarif_file: cx_result.sarif
40+
41+
quality:
42+
name: Quality scan
43+
runs-on: ubuntu-24.04
44+
permissions:
45+
contents: read
46+
47+
steps:
48+
- name: Check out repo
49+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
50+
with:
51+
fetch-depth: 0
52+
53+
- name: Scan with SonarCloud
54+
uses: sonarsource/sonarqube-scan-action@bfd4e558cda28cda6b5defafb9232d191be8c203 # v4.2.1
55+
env:
56+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
57+
with:
58+
args: >
59+
-Dsonar.organization=${{ github.repository_owner }}
60+
-Dsonar.projectKey=${{ github.repository_owner }}_${{ github.event.repository.name }}

.github/workflows/scan.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
1-
name: Scan
1+
name: Scan Pull Requests
22

33
on:
44
workflow_dispatch:
5-
push:
6-
branches:
7-
- "main"
8-
- "rc"
9-
- "hotfix-rc"
105
pull_request_target:
116
types: [opened, synchronize]
127
merge_group:
@@ -68,10 +63,9 @@ jobs:
6863
ref: ${{ github.event.pull_request.head.sha }}
6964

7065
- name: Scan with SonarCloud
71-
uses: sonarsource/sonarcloud-github-action@02ef91109b2d589e757aefcfb2854c2783fd7b19 # v4.0.0
66+
uses: sonarsource/sonarqube-scan-action@bfd4e558cda28cda6b5defafb9232d191be8c203 # v4.2.1
7267
env:
7368
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
74-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7569
with:
7670
args: >
7771
-Dsonar.organization=${{ github.repository_owner }}

0 commit comments

Comments
 (0)