Skip to content

Commit 0c0c174

Browse files
committed
Fix: Ensure SECURE_API_TOKEN is injected properly
1 parent 698337e commit 0c0c174

File tree

1 file changed

+25
-15
lines changed

1 file changed

+25
-15
lines changed

.github/workflows/scan.yml

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,58 +10,68 @@ jobs:
1010
image-scan:
1111
runs-on: ubuntu-latest
1212

13+
env:
14+
SYS_DIG_SECURE_URL: https://app.au1.sysdig.com
15+
1316
steps:
1417
- name: 🛎️ Checkout code
1518
uses: actions/checkout@v3
1619

17-
- name: 🏗️ Build Docker images
20+
- name: 🐳 Build Docker images
1821
run: |
1922
docker build -t voting-app ./vote
2023
docker build -t worker ./worker
2124
docker build -t result ./result
2225
23-
- name: 🔍 Run Sysdig Scan (voting-app)
26+
- name: 🔍 DEBUG: Check if SECURE_API_TOKEN is available
27+
run: |
28+
echo "🔍 Token Length: ${#SECURE_API_TOKEN}"
29+
echo "🔍 Token Head: ${SECURE_API_TOKEN::5}"
30+
if [ -z "$SECURE_API_TOKEN" ]; then
31+
echo "❌ SECURE_API_TOKEN is NOT set!"
32+
exit 1
33+
else
34+
echo "✅ SECURE_API_TOKEN is available."
35+
fi
2436
env:
2537
SECURE_API_TOKEN: ${{ secrets.SECURE_API_TOKEN }}
38+
39+
- name: 🔍 Run Sysdig Scan (voting-app)
2640
run: |
2741
docker run --rm \
2842
--platform linux/amd64 \
2943
--user 0 \
30-
-e SECURE_API_TOKEN=$SECURE_API_TOKEN \
3144
-v /var/run/docker.sock:/var/run/docker.sock \
45+
-e SECURE_API_TOKEN=${{ secrets.SECURE_API_TOKEN }} \
3246
quay.io/sysdig/sysdig-cli-scanner:1.22.4 \
33-
scan \
34-
--apiurl https://app.au1.sysdig.com \
47+
--apiurl $SYS_DIG_SECURE_URL \
3548
--skiptlsverify \
49+
--loglevel debug \
3650
docker://voting-app
3751
3852
- name: 🔍 Run Sysdig Scan (worker)
39-
env:
40-
SECURE_API_TOKEN: ${{ secrets.SECURE_API_TOKEN }}
4153
run: |
4254
docker run --rm \
4355
--platform linux/amd64 \
4456
--user 0 \
45-
-e SECURE_API_TOKEN=$SECURE_API_TOKEN \
4657
-v /var/run/docker.sock:/var/run/docker.sock \
58+
-e SECURE_API_TOKEN=${{ secrets.SECURE_API_TOKEN }} \
4759
quay.io/sysdig/sysdig-cli-scanner:1.22.4 \
48-
scan \
49-
--apiurl https://app.au1.sysdig.com \
60+
--apiurl $SYS_DIG_SECURE_URL \
5061
--skiptlsverify \
62+
--loglevel debug \
5163
docker://worker
5264
5365
- name: 🔍 Run Sysdig Scan (result)
54-
env:
55-
SECURE_API_TOKEN: ${{ secrets.SECURE_API_TOKEN }}
5666
run: |
5767
docker run --rm \
5868
--platform linux/amd64 \
5969
--user 0 \
60-
-e SECURE_API_TOKEN=$SECURE_API_TOKEN \
6170
-v /var/run/docker.sock:/var/run/docker.sock \
71+
-e SECURE_API_TOKEN=${{ secrets.SECURE_API_TOKEN }} \
6272
quay.io/sysdig/sysdig-cli-scanner:1.22.4 \
63-
scan \
64-
--apiurl https://app.au1.sysdig.com \
73+
--apiurl $SYS_DIG_SECURE_URL \
6574
--skiptlsverify \
75+
--loglevel debug \
6676
docker://result
6777

0 commit comments

Comments
 (0)