Skip to content

Commit b2948f3

Browse files
committed
Updated the co-pilot review
1 parent 3ce20f6 commit b2948f3

1 file changed

Lines changed: 25 additions & 25 deletions

File tree

.github/workflows/code-scans.yaml

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,13 @@ on:
1212
types: [opened, synchronize, reopened, ready_for_review]
1313

1414
concurrency:
15-
group: sdle-${{ github.event.pull_request.number || github.ref }}
15+
group: sdle-${{ github.event.inputs.PR_number || github.event.pull_request.number || github.ref }}
1616
cancel-in-progress: true
1717

18+
permissions:
19+
contents: read
20+
actions: read
21+
1822
jobs:
1923

2024
# -----------------------------
@@ -25,37 +29,32 @@ jobs:
2529
runs-on: self-hosted
2630
steps:
2731
- uses: actions/checkout@v4
32+
with:
33+
ref: ${{ github.event.inputs.PR_number && format('refs/pull/{0}/merge', github.event.inputs.PR_number) || '' }}
2834

2935
- name: Create report directory
3036
run: mkdir -p trivy-reports
3137

32-
- name: Install Trivy
33-
run: |
34-
# Check if trivy is already installed
35-
if ! command -v trivy &> /dev/null; then
36-
wget -qO- https://github.com/aquasecurity/trivy/releases/download/v0.55.0/trivy_0.55.0_Linux-64bit.tar.gz | tar -xzv -C /tmp
37-
sudo mv /tmp/trivy /usr/local/bin/
38-
fi
39-
trivy --version
40-
4138
- name: Run Trivy FS Scan
39+
uses: aquasecurity/trivy-action@0.28.0
4240
continue-on-error: true
43-
run: |
44-
trivy fs . \
45-
--scanners vuln,misconfig,secret \
46-
--severity CRITICAL,HIGH \
47-
--format table \
48-
--output trivy-reports/trivy_scan_report.txt
41+
with:
42+
scan-type: 'fs'
43+
scan-ref: '.'
44+
scanners: 'vuln,misconfig,secret'
45+
severity: 'CRITICAL,HIGH'
46+
format: 'table'
47+
output: 'trivy-reports/trivy_scan_report.txt'
4948

5049
- name: Run Trivy Image Scan - vllm-cpu
50+
uses: aquasecurity/trivy-action@0.28.0
5151
continue-on-error: true
52-
run: |
53-
trivy image \
54-
--severity HIGH,CRITICAL \
55-
--format table \
56-
--output trivy-reports/trivy-vllm-cpu.txt \
57-
public.ecr.aws/q9t5s3a7/vllm-cpu-release-repo:v0.10.2 || \
58-
echo "Image scan skipped - image not available locally" > trivy-reports/trivy-vllm-cpu.txt
52+
with:
53+
scan-type: 'image'
54+
image-ref: 'public.ecr.aws/q9t5s3a7/vllm-cpu-release-repo:v0.10.2'
55+
severity: 'HIGH,CRITICAL'
56+
format: 'table'
57+
output: 'trivy-reports/trivy-vllm-cpu.txt'
5958

6059
- name: Upload Trivy Reports
6160
if: always()
@@ -81,6 +80,7 @@ jobs:
8180
- name: Checkout
8281
uses: actions/checkout@v4
8382
with:
83+
ref: ${{ github.event.inputs.PR_number && format('refs/pull/{0}/merge', github.event.inputs.PR_number) || '' }}
8484
submodules: 'recursive'
8585
fetch-depth: 0
8686
- uses: actions/setup-python@v5
@@ -112,10 +112,10 @@ jobs:
112112
shellcheck_scan:
113113
name: ShellCheck script analysis
114114
runs-on: self-hosted
115-
permissions:
116-
contents: read
117115
steps:
118116
- uses: actions/checkout@v4
117+
with:
118+
ref: ${{ github.event.inputs.PR_number && format('refs/pull/{0}/merge', github.event.inputs.PR_number) || '' }}
119119

120120
- name: Create report directory
121121
run: mkdir -p shellcheck-reports

0 commit comments

Comments
 (0)