Skip to content

Commit bdfae55

Browse files
committed
gh-actions: fix artifact download-path
1 parent f0e09b7 commit bdfae55

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

.github/workflows/publish.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ jobs:
9999
printf 'vcsver=%s\n' "${sha:0:10}" >> "$GITHUB_OUTPUT"
100100
101101
- name: ⬇️ Download artifacts
102+
id: dlaar
102103
uses: actions/download-artifact@v4
103104
with:
104105
pattern: ${{ env.ARTIFACT_PATTERN }}
@@ -107,20 +108,22 @@ jobs:
107108
path: ${{ env.DIST_DIR }}
108109

109110
- name: ⬇️ Download SBOM artifact
111+
id: dlsbom
110112
uses: actions/download-artifact@v4
111113
with:
112114
pattern: ${{ env.SBOM_PATTERN }}
113115
run-id: ${{ env.RUN_ID }}
114116
github-token: ${{ github.token }}
115-
path: sbom
117+
path: ${{ env.DIST_DIR }}
116118

117119
- name: 🔐 Verify artifact attestations
118120
env:
119121
REPO: ${{ github.repository }}
120-
ART_DIR: ${{ env.DIST_DIR }}
122+
ART_DIR: ${{ steps.dlaar.outputs.download-path }}
121123
GH_TOKEN: ${{ github.token }}
122124
run: |
123125
set -euo pipefail
126+
ls -ltr "${ART_DIR}/"
124127
for file in "$ART_DIR/${FOUT}" "$ART_DIR/${FOUTDBG}"; do
125128
if [ ! -f "$file" ]; then
126129
echo "::error::missing artifact $file" >&2
@@ -150,21 +153,23 @@ jobs:
150153
- name: 🔐 Verify SBOM attestation
151154
env:
152155
REPO: ${{ github.repository }}
156+
ART_DIR: ${{ steps.dlsbom.outputs.download-path }}
153157
GH_TOKEN: ${{ github.token }}
154158
run: |
155159
# andrewlock.net/creating-sbom-attestations-in-github-actions/
156160
set -euo pipefail
161+
ls -ltr "${ART_DIR}/"
157162
if [ -n "${SBOM_INFO:-}" ]; then
158163
name=$(jq -r '.path' <<<"${SBOM_INFO}")
159-
sbom_file="sbom/$(jq -r '.artifactName' <<<"${SBOM_INFO}")/${name}"
164+
sbom_file="$ART_DIR/$(jq -r '.artifactName' <<<"${SBOM_INFO}")/${name}"
160165
digest=$(jq -r '.digest' <<<"${SBOM_INFO}")
161166
else
162-
sbom_file=$(find sbom -name "${SBOM_MANIFEST}" -print -quit)
167+
sbom_file=$(find "${ART_DIR}" -name "${SBOM_MANIFEST}" -print -quit)
163168
digest=""
164169
fi
165170
166171
if [ -z "$sbom_file" ]; then
167-
echo "::error::SBOM file not found in sbom/" >&2
172+
echo "::error::SBOM file not found in ${ART_DIR}/" >&2
168173
exit 15
169174
fi
170175
@@ -175,6 +180,8 @@ jobs:
175180
echo "::error::SBOM digest mismatch (got $got, want $want)" >&2
176181
exit 16
177182
fi
183+
else
184+
echo "No SBOM digest; skipping digest verification" >&2
178185
fi
179186
180187
gh attestation verify "$sbom_file" -R "$REPO" --predicate-type "${SBOM_PREDICATE}"

0 commit comments

Comments
 (0)