Skip to content

Commit 4b95f57

Browse files
1bltclaude
andcommitted
refactor(ci): simplify security scan PR comment using Argus
Remove duplicate summary logic (shell script + 100-line JavaScript) and let Argus security-summary action handle PR commenting directly with post_pr_comment: true. Reduces summary job from ~180 lines to 12 lines. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent e0a939d commit 4b95f57

1 file changed

Lines changed: 8 additions & 57 deletions

File tree

.github/workflows/argus-security.yml

Lines changed: 8 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ jobs:
123123
- uses: huntridge-labs/argus/.github/actions/scanner-gitleaks@0.6.8
124124
with:
125125
enable_code_security: true
126+
post_pr_comment: false
126127
env:
127128
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
128129
GITLEAKS_LICENSE: ${{ secrets.GITLEAKS_LICENSE }}
@@ -133,6 +134,7 @@ jobs:
133134
with:
134135
languages: ${{ needs.detect.outputs.languages }}
135136
enable_code_security: true
137+
post_pr_comment: false
136138
env:
137139
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
138140

@@ -141,6 +143,7 @@ jobs:
141143
if: needs.detect.outputs.languages != ''
142144
with:
143145
enable_code_security: true
146+
post_pr_comment: false
144147
env:
145148
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
146149

@@ -149,6 +152,7 @@ jobs:
149152
if: contains(needs.detect.outputs.languages, 'python')
150153
with:
151154
enable_code_security: true
155+
post_pr_comment: false
152156
env:
153157
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
154158

@@ -169,12 +173,14 @@ jobs:
169173
with:
170174
image_ref: scan-target:${{ github.sha }}
171175
enable_code_security: true
176+
post_pr_comment: false
172177
env:
173178
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
174179

175180
- uses: huntridge-labs/argus/.github/actions/scanner-syft@0.6.8
176181
with:
177182
image_ref: scan-target:${{ github.sha }}
183+
post_pr_comment: false
178184
env:
179185
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
180186

@@ -189,12 +195,14 @@ jobs:
189195
- uses: huntridge-labs/argus/.github/actions/scanner-trivy-iac@0.6.8
190196
with:
191197
enable_code_security: true
198+
post_pr_comment: false
192199
env:
193200
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
194201

195202
- uses: huntridge-labs/argus/.github/actions/scanner-checkov@0.6.8
196203
with:
197204
enable_code_security: true
205+
post_pr_comment: false
198206
env:
199207
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
200208

@@ -204,65 +212,8 @@ jobs:
204212
if: always()
205213
runs-on: ubuntu-latest
206214
steps:
207-
- uses: actions/checkout@v4
208-
209-
- name: Generate scan summary
210-
env:
211-
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
212-
DETECTED_LANGUAGES: ${{ needs.detect.outputs.languages }}
213-
HAS_CONTAINER: ${{ needs.detect.outputs.has_container }}
214-
CONTAINER_BUILDABLE: ${{ needs.detect.outputs.container_buildable }}
215-
HAS_IAC: ${{ needs.detect.outputs.has_iac }}
216-
SAST_RESULT: ${{ needs.sast.result }}
217-
CONTAINER_RESULT: ${{ needs.container.result }}
218-
INFRA_RESULT: ${{ needs.infrastructure.result }}
219-
run: |
220-
echo "## 🔒 Security Scan Summary" >> $GITHUB_STEP_SUMMARY
221-
echo "" >> $GITHUB_STEP_SUMMARY
222-
echo "**Commit:** [\`${GITHUB_SHA:0:7}\`]($GITHUB_SERVER_URL/$GITHUB_REPOSITORY/commit/$GITHUB_SHA)" >> $GITHUB_STEP_SUMMARY
223-
echo "**Branch:** \`$BRANCH_NAME\`" >> $GITHUB_STEP_SUMMARY
224-
echo "" >> $GITHUB_STEP_SUMMARY
225-
226-
echo "### 🔍 Stack Detection" >> $GITHUB_STEP_SUMMARY
227-
echo "| Component | Detected | Scanned |" >> $GITHUB_STEP_SUMMARY
228-
echo "|-----------|----------|---------|" >> $GITHUB_STEP_SUMMARY
229-
230-
if [ -n "$DETECTED_LANGUAGES" ]; then
231-
echo "| **Languages** | $DETECTED_LANGUAGES | ✅ SAST |" >> $GITHUB_STEP_SUMMARY
232-
else
233-
echo "| **Languages** | None | ⏭️ Skipped |" >> $GITHUB_STEP_SUMMARY
234-
fi
235-
236-
if [ "$HAS_CONTAINER" = "true" ]; then
237-
if [ "$CONTAINER_BUILDABLE" = "true" ]; then
238-
echo "| **Container** | Dockerfile | ✅ Scanned |" >> $GITHUB_STEP_SUMMARY
239-
else
240-
echo "| **Container** | Dockerfile (private registry) | ⏭️ Skipped |" >> $GITHUB_STEP_SUMMARY
241-
fi
242-
else
243-
echo "| **Container** | None | ⏭️ Skipped |" >> $GITHUB_STEP_SUMMARY
244-
fi
245-
246-
if [ "$HAS_IAC" = "true" ]; then
247-
echo "| **Infrastructure** | Terraform/CloudFormation | ✅ Scanned |" >> $GITHUB_STEP_SUMMARY
248-
else
249-
echo "| **Infrastructure** | None | ⏭️ Skipped |" >> $GITHUB_STEP_SUMMARY
250-
fi
251-
252-
echo "" >> $GITHUB_STEP_SUMMARY
253-
echo "### 📊 Job Results" >> $GITHUB_STEP_SUMMARY
254-
echo "| Job | Status |" >> $GITHUB_STEP_SUMMARY
255-
echo "|-----|--------|" >> $GITHUB_STEP_SUMMARY
256-
echo "| SAST Scanning | $SAST_RESULT |" >> $GITHUB_STEP_SUMMARY
257-
echo "| Container Scanning | $CONTAINER_RESULT |" >> $GITHUB_STEP_SUMMARY
258-
echo "| Infrastructure Scanning | $INFRA_RESULT |" >> $GITHUB_STEP_SUMMARY
259-
echo "" >> $GITHUB_STEP_SUMMARY
260-
echo "---" >> $GITHUB_STEP_SUMMARY
261-
echo "_View detailed findings in the [Security tab]($GITHUB_SERVER_URL/$GITHUB_REPOSITORY/security/code-scanning)_" >> $GITHUB_STEP_SUMMARY
262-
263215
- uses: huntridge-labs/argus/.github/actions/security-summary@0.6.8
264216
with:
265217
post_pr_comment: true
266-
title: "🔒 Security Scan Results"
267218
env:
268219
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)