Skip to content

Commit c40bed6

Browse files
committed
Enable content trust
1 parent cba7a2d commit c40bed6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

.github/workflows/docker-image.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,6 @@ jobs:
5252
- name: ⬇️ Checkout code
5353
uses: actions/checkout@v4
5454

55-
- name: Enable Content Trust
56-
run: |
57-
echo "DOCKER_CONTENT_TRUST=1" >> "$GITHUB_ENV"
58-
5955
# -------------------------------------------------------------
6056
# 0️⃣.5️⃣ Derive lower-case IMAGE_NAME for Docker tag
6157
# -------------------------------------------------------------
@@ -100,6 +96,8 @@ jobs:
10096
# 3️⃣ Build & tag image (timestamp + latest)
10197
# -------------------------------------------------------------
10298
- name: 🏗️ Build Docker image
99+
env:
100+
DOCKER_CONTENT_TRUST: "1"
103101
run: |
104102
TAG=$(date +%s)
105103
echo "TAG=$TAG" >> "$GITHUB_ENV"
@@ -173,6 +171,8 @@ jobs:
173171
password: ${{ secrets.GITHUB_TOKEN }}
174172

175173
- name: 🚀 Push image to GHCR
174+
env:
175+
DOCKER_CONTENT_TRUST: "1"
176176
run: |
177177
docker push $IMAGE_NAME:${{ env.TAG }}
178178
docker push $IMAGE_NAME:latest
@@ -190,7 +190,7 @@ jobs:
190190
for REF in $IMAGE_NAME:latest $IMAGE_NAME:${{ env.TAG }}; do
191191
echo "🔑 Signing $REF"
192192
cosign sign --yes "$REF"
193-
193+
194194
echo "📝 Attesting SBOM for $REF"
195195
cosign attest --yes \
196196
--predicate sbom.spdx.json \

0 commit comments

Comments
 (0)