Skip to content

Commit d8c384c

Browse files
committed
testing workflow with no cache
1 parent 533ef21 commit d8c384c

File tree

1 file changed

+39
-40
lines changed

1 file changed

+39
-40
lines changed

.github/workflows/build-images.yml

Lines changed: 39 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@ name: Build All Services
33
on:
44
push:
55
branches:
6-
- '*'
6+
- "*"
77
tags:
8-
- '*'
8+
- "*"
99
paths:
10-
- 'apps/api-gateway/**'
11-
- 'apps/api/**'
12-
- 'apps/web/**'
13-
- '.github/workflows/build-images.yml'
10+
- "apps/api-gateway/**"
11+
- "apps/api/**"
12+
- "apps/web/**"
13+
- ".github/workflows/build-images.yml"
1414
pull_request:
1515
branches:
16-
- master
16+
- master
1717
schedule:
18-
- cron: 0 5 * * *
18+
- cron: 0 5 * * *
1919
workflow_dispatch:
2020
inputs:
2121
suffix:
@@ -59,8 +59,8 @@ jobs:
5959
if: steps.changes.outputs.needs_scan == 'true'
6060
uses: actions/setup-node@v4
6161
with:
62-
node-version: '22.0.0'
63-
cache: 'yarn'
62+
node-version: "22.0.0"
63+
cache: "yarn"
6464

6565
- name: Configure Yarn
6666
if: steps.changes.outputs.needs_scan == 'true'
@@ -82,27 +82,27 @@ jobs:
8282
if: steps.changes.outputs.needs_scan == 'true'
8383
uses: aquasecurity/trivy-action@master
8484
with:
85-
scan-type: 'fs'
86-
scan-ref: 'apps/${{ matrix.service }}'
87-
format: 'sarif'
88-
output: 'trivy-fs-${{ matrix.service }}.sarif'
89-
severity: 'UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL'
85+
scan-type: "fs"
86+
scan-ref: "apps/${{ matrix.service }}"
87+
format: "sarif"
88+
output: "trivy-fs-${{ matrix.service }}.sarif"
89+
severity: "UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL"
9090
continue-on-error: true
9191

9292
- name: Display filesystem security scan results
9393
if: steps.changes.outputs.needs_scan == 'true'
9494
run: |
9595
echo "🔍 FILESYSTEM SECURITY SCAN RESULTS FOR ${{ matrix.service }}"
9696
echo "================================================="
97-
97+
9898
# Run Trivy again with table format for readable output (show ALL vulnerabilities)
9999
echo "📊 DETAILED VULNERABILITY TABLE:"
100100
docker run --rm -v "$PWD:/workspace" aquasec/trivy:latest fs \
101101
--format table \
102102
--severity UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL \
103103
--ignore-unfixed=false \
104104
/workspace/apps/${{ matrix.service }} || true
105-
105+
106106
echo ""
107107
echo "📋 SUMMARY BY SEVERITY:"
108108
docker run --rm -v "$PWD:/workspace" aquasec/trivy:latest fs \
@@ -111,7 +111,7 @@ jobs:
111111
--ignore-unfixed=false \
112112
/workspace/apps/${{ matrix.service }} 2>/dev/null | \
113113
jq -r '.Results[]?.Vulnerabilities[]? | .Severity' | sort | uniq -c | sort -nr || true
114-
114+
115115
echo ""
116116
echo "📄 Detailed SARIF report saved as trivy-fs-${{ matrix.service }}.sarif"
117117
continue-on-error: true
@@ -121,19 +121,19 @@ jobs:
121121
run: |
122122
echo "🔍 DEPENDENCY SECURITY AUDIT FOR ${{ matrix.service }}"
123123
echo "==============================================="
124-
124+
125125
# Generate comprehensive JSON report (all dependencies, all severity levels)
126126
yarn audit --json > yarn-audit-${{ matrix.service }}-full.json || true
127127
yarn audit --groups dependencies --level info --json > yarn-audit-${{ matrix.service }}.json || true
128-
128+
129129
# Display human-readable report directly in workflow (show ALL vulnerabilities)
130130
echo "📊 VULNERABILITY SUMMARY (ALL SEVERITIES):"
131131
echo "--- ALL DEPENDENCIES (including dev) ---"
132132
yarn audit || true
133133
echo ""
134134
echo "--- PRODUCTION DEPENDENCIES ONLY ---"
135135
yarn audit --groups dependencies --level info || true
136-
136+
137137
echo ""
138138
echo "📄 Reports saved:"
139139
echo " - yarn-audit-${{ matrix.service }}-full.json (all deps, all severities)"
@@ -147,11 +147,11 @@ jobs:
147147
echo "========================"
148148
149149
pip install git+https://github.com/IBM/detect-secrets.git@0.13.1+ibm.64.dss
150-
150+
151151
# Run scan and show results
152152
echo "🔎 Scanning for potential secrets..."
153153
detect-secrets scan --update .secrets.baseline
154-
154+
155155
# Display baseline file if it exists
156156
if [ -f ".secrets.baseline" ]; then
157157
echo "📊 SECRETS BASELINE SUMMARY:"
@@ -184,7 +184,7 @@ jobs:
184184
if: always() && steps.changes.outputs.needs_scan == 'true' && steps.sarif-check.outputs.sarif_exists == 'true'
185185
uses: github/codeql-action/upload-sarif@v3
186186
with:
187-
sarif_file: 'trivy-fs-${{ matrix.service }}.sarif'
187+
sarif_file: "trivy-fs-${{ matrix.service }}.sarif"
188188
category: trivy-fs-${{ matrix.service }}
189189

190190
- name: Upload security reports as artifacts
@@ -233,8 +233,8 @@ jobs:
233233
if: steps.changes.outputs.needs_build == 'true'
234234
uses: actions/setup-node@v4
235235
with:
236-
node-version: '22.0.0'
237-
cache: 'yarn'
236+
node-version: "22.0.0"
237+
cache: "yarn"
238238

239239
- name: Configure Yarn
240240
if: steps.changes.outputs.needs_build == 'true'
@@ -338,34 +338,34 @@ jobs:
338338
tags: |
339339
ghcr.io/${{ github.repository }}/mark-${{ matrix.service }}:${{ env.IMAGE_TAG }}
340340
ghcr.io/${{ github.repository }}/mark-${{ matrix.service }}:latest
341-
cache-from: type=gha,scope=${{ matrix.service }}
342-
cache-to: type=gha,mode=max,scope=${{ matrix.service }}
341+
# cache-from: type=gha,scope=${{ matrix.service }}
342+
# cache-to: type=gha,mode=max,scope=${{ matrix.service }}
343343
platforms: linux/amd64
344344

345345
- name: Run container security scan
346346
if: steps.changes.outputs.needs_build == 'true'
347347
uses: aquasecurity/trivy-action@master
348348
with:
349349
image-ref: ghcr.io/${{ github.repository }}/mark-${{ matrix.service }}:${{ env.IMAGE_TAG }}
350-
format: 'sarif'
351-
output: 'trivy-container-${{ matrix.service }}.sarif'
352-
severity: 'UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL'
350+
format: "sarif"
351+
output: "trivy-container-${{ matrix.service }}.sarif"
352+
severity: "UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL"
353353
continue-on-error: true
354354

355355
- name: Display container security scan results
356356
if: steps.changes.outputs.needs_build == 'true'
357357
run: |
358358
echo "🔍 CONTAINER SECURITY SCAN RESULTS FOR ${{ matrix.service }}"
359359
echo "===================================================="
360-
360+
361361
# Run Trivy again with table format for readable output (show ALL vulnerabilities)
362362
echo "📊 DETAILED VULNERABILITY TABLE:"
363363
docker run --rm aquasec/trivy:latest image \
364364
--format table \
365365
--severity UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL \
366366
--ignore-unfixed=false \
367367
ghcr.io/${{ github.repository }}/mark-${{ matrix.service }}:${{ env.IMAGE_TAG }} || true
368-
368+
369369
echo ""
370370
echo "📋 SUMMARY BY SEVERITY:"
371371
docker run --rm aquasec/trivy:latest image \
@@ -374,7 +374,7 @@ jobs:
374374
--ignore-unfixed=false \
375375
ghcr.io/${{ github.repository }}/mark-${{ matrix.service }}:${{ env.IMAGE_TAG }} 2>/dev/null | \
376376
jq -r '.Results[]?.Vulnerabilities[]? | .Severity' | sort | uniq -c | sort -nr || true
377-
377+
378378
echo ""
379379
echo "📄 Detailed SARIF report saved as trivy-container-${{ matrix.service }}.sarif"
380380
continue-on-error: true
@@ -394,7 +394,7 @@ jobs:
394394
if: always() && steps.changes.outputs.needs_build == 'true' && steps.container-sarif-check.outputs.sarif_exists == 'true'
395395
uses: github/codeql-action/upload-sarif@v3
396396
with:
397-
sarif_file: 'trivy-container-${{ matrix.service }}.sarif'
397+
sarif_file: "trivy-container-${{ matrix.service }}.sarif"
398398
category: trivy-container-${{ matrix.service }}
399399

400400
- name: Upload container security reports as artifacts
@@ -425,7 +425,7 @@ jobs:
425425
run: |
426426
echo "## Security Scan Summary for ${{ matrix.service }}" >> $GITHUB_STEP_SUMMARY
427427
echo "" >> $GITHUB_STEP_SUMMARY
428-
428+
429429
# Filesystem scan summary
430430
if [ -f "trivy-fs-${{ matrix.service }}.sarif" ]; then
431431
CRITICAL=$(jq '.runs[0].results[] | select(.level == "error" and (.ruleId | contains("CRITICAL")))' trivy-fs-${{ matrix.service }}.sarif | wc -l)
@@ -437,7 +437,7 @@ jobs:
437437
echo "- Medium: $MEDIUM" >> $GITHUB_STEP_SUMMARY
438438
echo "" >> $GITHUB_STEP_SUMMARY
439439
fi
440-
440+
441441
# Container scan summary
442442
if [ -f "trivy-container-${{ matrix.service }}.sarif" ]; then
443443
CRITICAL=$(jq '.runs[0].results[] | select(.level == "error" and (.ruleId | contains("CRITICAL")))' trivy-container-${{ matrix.service }}.sarif | wc -l)
@@ -449,7 +449,7 @@ jobs:
449449
echo "- Medium: $MEDIUM" >> $GITHUB_STEP_SUMMARY
450450
echo "" >> $GITHUB_STEP_SUMMARY
451451
fi
452-
452+
453453
# Dependency audit summary
454454
if [ -f "yarn-audit-${{ matrix.service }}.json" ]; then
455455
ADVISORIES=$(jq '.metadata.totalDependencies // 0' yarn-audit-${{ matrix.service }}.json)
@@ -459,6 +459,5 @@ jobs:
459459
echo "- Vulnerabilities Found: $VULNERABILITIES" >> $GITHUB_STEP_SUMMARY
460460
echo "" >> $GITHUB_STEP_SUMMARY
461461
fi
462-
463-
echo "📊 **View detailed reports in the workflow artifacts**" >> $GITHUB_STEP_SUMMARY
464462
463+
echo "📊 **View detailed reports in the workflow artifacts**" >> $GITHUB_STEP_SUMMARY

0 commit comments

Comments
 (0)