3434 type : string
3535 required : false
3636 default : ' '
37- nix-version :
38- description : ' Pinned Nix version used for deterministic builds (must match other CI systems)'
39- required : false
40- type : string
41- default : ' 2.34.4'
4237 secrets :
4338 devguard-token :
4439 description : ' DevGuard API token'
@@ -67,18 +62,11 @@ jobs:
6762 submodules : recursive
6863 persist-credentials : false
6964
70- - uses : cachix/install-nix-action@v31
71- with :
72- install_url : ${{ format('https://releases.nixos.org/nix/nix-{0}/install', inputs.nix-version) }}
73- extra_nix_config : |
74- experimental-features = nix-command flakes
75-
76- - name : Install crane and devguard-scanner
77- run : nix profile install nixpkgs#crane github:l3montree-dev/devguard#devguardScanner
78-
7965 - name : In-Toto Provenance record start
8066 id : in-toto-start
81- run : devguard-scanner intoto start --step=build --token=${{ secrets.devguard-token }} --apiUrl=${{ inputs.api-url }} --assetName=${{ inputs.asset-name }} --supplyChainId=${{ github.sha }}
67+ uses : docker://ghcr.io/l3montree-dev/devguard/scanner:main
68+ with :
69+ args : devguard-scanner intoto start --step=build --token=${{ secrets.devguard-token }} --apiUrl=${{ inputs.api-url }} --assetName=${{ inputs.asset-name }} --supplyChainId=${{ github.sha }}
8270 continue-on-error : true
8371
8472 - name : Build Docker image with Kaniko
9583
9684 - name : Use crane to get the digest
9785 run : |
98- crane digest --tarball="${IMAGE_DESTINATION_PATH}" > image-digest.txt
86+ docker run --rm \
87+ -v "$GITHUB_WORKSPACE:/workspace" \
88+ -w /workspace \
89+ ghcr.io/l3montree-dev/devguard/scanner:main \
90+ crane digest --tarball="${IMAGE_DESTINATION_PATH}" > image-digest.txt
9991 env :
10092 IMAGE_DESTINATION_PATH : ${{ inputs.image-destination-path }}
10193
@@ -109,6 +101,9 @@ jobs:
109101
110102 - name : Set image tag
111103 id : set-image-tag
104+ env :
105+ IMAGE_SUFFIX : ${{ inputs.image-suffix }}
106+ IMAGE : ${{ inputs.image }}
112107 run : |
113108 if [ -n "$IMAGE" ]; then
114109 IMAGE_TAG="$IMAGE"
@@ -120,10 +115,14 @@ jobs:
120115 else
121116 IMAGE_PATH="ghcr.io/${GITHUB_REPOSITORY}"
122117 fi
123- devguard-scanner generate-tag \
124- --imagePath="$IMAGE_PATH" \
125- --ref="$GITHUB_REF_NAME" \
126- >> image-tag-env.txt
118+ docker run --rm \
119+ -e IMAGE_PATH \
120+ -e GITHUB_REF_NAME \
121+ ghcr.io/l3montree-dev/devguard/scanner:main \
122+ devguard-scanner generate-tag \
123+ --imagePath="$IMAGE_PATH" \
124+ --ref="$GITHUB_REF_NAME" \
125+ >> image-tag-env.txt
127126 IMAGE_TAG=$(grep '^IMAGE_TAG=' image-tag-env.txt | cut -d= -f2-)
128127 ARTIFACT_NAME=$(grep '^ARTIFACT_NAME=' image-tag-env.txt | cut -d= -f2-)
129128 ARTIFACT_URL_ENCODED=$(grep '^ARTIFACT_URL_ENCODED=' image-tag-env.txt | cut -d= -f2-)
@@ -132,13 +131,16 @@ jobs:
132131 echo "ARTIFACT_NAME=$ARTIFACT_NAME" >> "$GITHUB_ENV"
133132 echo "ARTIFACT_URL_ENCODED=$ARTIFACT_URL_ENCODED" >> "$GITHUB_ENV"
134133 fi
135- env :
136- IMAGE_SUFFIX : ${{ inputs.image-suffix }}
137- IMAGE : ${{ inputs.image }}
138134
139135 - name : Upload to container registry
140136 run : |
141- crane push "${IMAGE_DESTINATION_PATH}" $(cat image-tag.txt)
137+ docker run --rm \
138+ -v "$GITHUB_WORKSPACE:/workspace" \
139+ -w /workspace \
140+ -v "$DOCKER_CONFIG:/root/.docker:ro" \
141+ -e DOCKER_CONFIG=/root/.docker \
142+ ghcr.io/l3montree-dev/devguard/scanner:main \
143+ crane push "${IMAGE_DESTINATION_PATH}" "$(cat image-tag.txt)"
142144 env :
143145 IMAGE_DESTINATION_PATH : ${{ inputs.image-destination-path }}
144146 if : inputs.disable-artifact-registry-as-image-store == true
@@ -186,7 +188,9 @@ jobs:
186188 path : image-tag.txt
187189
188190 - name : In-Toto Provenance record stop
189- run : devguard-scanner intoto stop --step=build --products=image-digest.txt --products=image-tag.txt --token=${{ secrets.devguard-token }} --apiUrl=${{ inputs.api-url }} --assetName=${{ inputs.asset-name }} --supplyChainId=${{ github.sha }} --generateSlsaProvenance
191+ uses : docker://ghcr.io/l3montree-dev/devguard/scanner:main
192+ with :
193+ args : devguard-scanner intoto stop --step=build --products=image-digest.txt --products=image-tag.txt --token=${{ secrets.devguard-token }} --apiUrl=${{ inputs.api-url }} --assetName=${{ inputs.asset-name }} --supplyChainId=${{ github.sha }} --generateSlsaProvenance
190194 continue-on-error : true
191195
192196 - name : Upload SLSA Provenance
0 commit comments