Skip to content

Commit b9d4997

Browse files
committed
fix: Sanitize artifact name
1 parent 4811ea9 commit b9d4997

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

.github/workflows/docker.yml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,13 @@ jobs:
112112
run: |
113113
echo "digest=${{ steps.build.outputs.digest }}" >> $GITHUB_OUTPUT
114114
115+
- name: Sanitize tag for artifact names
116+
id: safe_tag
117+
run: |
118+
RAW_TAG="${{ steps.docker_tags.outputs.tag_name }}"
119+
SAFE_TAG=$(echo "$RAW_TAG" | tr -cd '[:alnum:]-')
120+
echo "safe_tag=${SAFE_TAG}" >> $GITHUB_OUTPUT
121+
115122
- name: Generate SBOM (SPDX)
116123
if: github.event_name != 'workflow_dispatch' || github.event.inputs.dry_run != 'true'
117124
id: sbom
@@ -120,16 +127,7 @@ jobs:
120127
image: ${{ matrix.image }}:${{ steps.docker_tags.outputs.tag_name }}
121128
format: spdx-json
122129
output-file: sbom.spdx.json
123-
artifact-name: domain-locker-sbom-${{ steps.docker_tags.outputs.tag_name }}
124-
125-
126-
- name: Generate provenance attestation
127-
if: github.event_name != 'workflow_dispatch' || github.event.inputs.dry_run != 'true'
128-
uses: actions/attest-build-provenance@v2
129-
with:
130-
subject-name: ${{ matrix.image }}
131-
subject-digest: ${{ steps.digest.outputs.digest }}
132-
push-to-registry: true
130+
artifact-name: domain-locker-sbom-${{ steps.safe_tag.outputs.safe_tag }}
133131

134132
- name: Attest SBOM to registry
135133
if: github.event_name != 'workflow_dispatch' || github.event.inputs.dry_run != 'true'

0 commit comments

Comments
 (0)