Skip to content

Commit bd11814

Browse files
committed
Fix: Ensure SECURE_TOKEN is injected properly
1 parent 40634ca commit bd11814

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

.github/workflows/scan.yml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,42 @@
1-
name: Sysdig Image Scan
1+
name: Voting App Build & Scan
22

33
on:
44
push:
55
branches:
66
- main
7+
pull_request:
78
workflow_dispatch:
89

910
jobs:
10-
image-scan:
11+
build-and-scan:
1112
runs-on: ubuntu-latest
1213

1314
env:
1415
SYS_DIG_SECURE_URL: https://app.au1.sysdig.com
1516

1617
steps:
17-
- name: Checkout code
18+
- name: Checkout source
1819
uses: actions/checkout@v3
1920

20-
- name: Build Docker images
21+
- name: Set up Docker Buildx
22+
uses: docker/setup-buildx-action@v2
23+
24+
- name: Log in to DockerHub (optional)
25+
if: secrets.DOCKERHUB_USERNAME && secrets.DOCKERHUB_TOKEN
26+
uses: docker/login-action@v2
27+
with:
28+
username: ${{ secrets.DOCKERHUB_USERNAME }}
29+
password: ${{ secrets.DOCKERHUB_TOKEN }}
30+
31+
- name: Build Voting App images
2132
run: |
2233
docker build -t voting-app ./vote
2334
docker build -t worker ./worker
2435
docker build -t result ./result
2536
26-
- name: Debug
37+
- name: Scan image with Sysdig CLI Scanner
2738
env:
2839
SECURE_API_TOKEN: ${{ secrets.SECURE_API_TOKEN }}
29-
run: |
30-
echo "🔍 Token Length: ${#SECURE_API_TOKEN}"
31-
echo "🔍 Token Head: ${SECURE_API_TOKEN:0:5}"
32-
if [ -z "$SECURE_API_TOKEN" ]; then
33-
echo "❌ SECURE_API_TOKEN is NOT set!"
34-
exit 1
35-
else
36-
echo "✅ SECURE_API_TOKEN is available."
37-
fi
38-
39-
- name: Run Sysdig Scan (voting-app)
4040
run: |
4141
docker run --rm \
4242
--platform linux/amd64 \
@@ -46,7 +46,7 @@ jobs:
4646
-e SECURE_API_TOKEN="${{ secrets.SECURE_API_TOKEN }}" \
4747
quay.io/sysdig/sysdig-cli-scanner:1.22.4 \
4848
--apiurl "$SYS_DIG_SECURE_URL" \
49-
--loglevel debug \
49+
--loglevel info \
5050
--skiptlsverify \
5151
docker://voting-app
5252

0 commit comments

Comments
 (0)