Skip to content

Commit 18c7333

Browse files
authored
Revert "[PM-19821] Consolidate scan.yml and scan-ci.yml" (#5058)
1 parent b6d9bee commit 18c7333

File tree

2 files changed

+63
-9
lines changed

2 files changed

+63
-9
lines changed

.github/workflows/scan-ci.yml

+60
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@184bf2f64f55d1c93fd6636d539edf274703e434 # 2.0.41
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@b6a472f63d85b9c78a3ac5e89422239fc15e9b3c # v3.28.1
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

+3-9
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
1-
name: Scan
1+
name: Scan Pull Requests
22

33
on:
44
workflow_dispatch:
5-
push:
6-
branches:
7-
- "main"
8-
- "release/**"
9-
- "rc"
10-
- "hotfix-rc"
115
pull_request_target:
126
types: [opened, synchronize]
137

@@ -29,7 +23,7 @@ jobs:
2923
- name: Check out repo
3024
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3125
with:
32-
ref: ${{ github.event.pull_request.head.sha }}
26+
ref: ${{ github.event.pull_request.head.sha }}
3327

3428
- name: Scan with Checkmarx
3529
uses: checkmarx/ast-github-action@184bf2f64f55d1c93fd6636d539edf274703e434 # 2.0.41
@@ -66,7 +60,7 @@ jobs:
6660
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
6761
with:
6862
fetch-depth: 0
69-
ref: ${{ github.event.pull_request.head.sha }}
63+
ref: ${{ github.event.pull_request.head.sha }}
7064

7165
- name: Scan with SonarCloud
7266
uses: sonarsource/sonarqube-scan-action@bfd4e558cda28cda6b5defafb9232d191be8c203 # v4.2.1

0 commit comments

Comments
 (0)