@@ -216,26 +216,19 @@ jobs:
216216 contents : read
217217 packages : write
218218 steps :
219+ - name : Check out workflow scripts
220+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
221+ with :
222+ persist-credentials : false
223+
219224 - name : Resolve release tag
220225 id : rel
221226 env :
222227 DISPATCH_TAG : ${{ inputs.docker_backfill_tag }}
223228 RELEASE_TAG : ${{ needs.release-please.outputs.tag_name }}
224229 run : |
225230 set -euo pipefail
226- TAG="${DISPATCH_TAG:-$RELEASE_TAG}"
227- case "$TAG" in
228- ""|*[!A-Za-z0-9._-]*)
229- echo "::error::release tag is empty or contains invalid characters"
230- exit 1
231- ;;
232- esac
233- case "$TAG" in
234- v[0-9]*) ;;
235- *) echo "::error::'$TAG' does not look like a release tag (vX.Y.Z)"; exit 1 ;;
236- esac
237- printf '%s\n' "tag=$TAG" >> "$GITHUB_OUTPUT"
238- printf '%s\n' "version=${TAG#v}" >> "$GITHUB_OUTPUT"
231+ scripts/resolve-release-tag.sh "${DISPATCH_TAG:-$RELEASE_TAG}"
239232 # ghcr requires a lowercase repository path, and unlike metadata-action,
240233 # buildx's `--output name=` does no lowercasing — a mixed-case owner
241234 # makes the digest push fail with "invalid reference format".
@@ -317,28 +310,22 @@ jobs:
317310 if : ${{ !cancelled() && needs.docker.result == 'success' }}
318311 runs-on : ubuntu-latest
319312 permissions :
313+ contents : read
320314 packages : write
321315 steps :
316+ - name : Check out workflow scripts
317+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
318+ with :
319+ persist-credentials : false
320+
322321 - name : Resolve release tag
323322 id : rel
324323 env :
325324 DISPATCH_TAG : ${{ inputs.docker_backfill_tag }}
326325 RELEASE_TAG : ${{ needs.release-please.outputs.tag_name }}
327326 run : |
328327 set -euo pipefail
329- TAG="${DISPATCH_TAG:-$RELEASE_TAG}"
330- case "$TAG" in
331- ""|*[!A-Za-z0-9._-]*)
332- echo "::error::release tag is empty or contains invalid characters"
333- exit 1
334- ;;
335- esac
336- case "$TAG" in
337- v[0-9]*) ;;
338- *) echo "::error::'$TAG' does not look like a release tag (vX.Y.Z)"; exit 1 ;;
339- esac
340- printf '%s\n' "tag=$TAG" >> "$GITHUB_OUTPUT"
341- printf '%s\n' "version=${TAG#v}" >> "$GITHUB_OUTPUT"
328+ scripts/resolve-release-tag.sh "${DISPATCH_TAG:-$RELEASE_TAG}"
342329
343330 - name : Download digests
344331 uses : actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
@@ -554,26 +541,19 @@ jobs:
554541 contents : read
555542 id-token : write # npm trusted publishing (OIDC) + provenance
556543 steps :
544+ - name : Check out workflow scripts
545+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
546+ with :
547+ persist-credentials : false
548+
557549 - name : Resolve release tag
558550 id : rel
559551 env :
560552 DISPATCH_TAG : ${{ inputs.npm_backfill_tag }}
561553 RELEASE_TAG : ${{ needs.release-please.outputs.tag_name }}
562554 run : |
563555 set -euo pipefail
564- TAG="${DISPATCH_TAG:-$RELEASE_TAG}"
565- case "$TAG" in
566- ""|*[!A-Za-z0-9._-]*)
567- echo "::error::release tag is empty or contains invalid characters"
568- exit 1
569- ;;
570- esac
571- case "$TAG" in
572- v[0-9]*) ;;
573- *) echo "::error::'$TAG' does not look like a release tag (vX.Y.Z)"; exit 1 ;;
574- esac
575- printf '%s\n' "tag=$TAG" >> "$GITHUB_OUTPUT"
576- printf '%s\n' "version=${TAG#v}" >> "$GITHUB_OUTPUT"
556+ scripts/resolve-release-tag.sh "${DISPATCH_TAG:-$RELEASE_TAG}"
577557
578558 - name : Checkout release tag
579559 uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
0 commit comments