Keep the dev tag check strict and default the tag in the workflow
The earlier script default broke the tests that reject empty tags. The workflow now falls back to dev-<full commit SHA> for manual runs. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
727f5b0261
commit
91d3b9c9f2
2 files changed
+2
-2
No files matched your search
@@ -35,7 +35,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
EVENT_NAME: ${{ github.event_name }}
|
EVENT_NAME: ${{ github.event_name }}
|
||||||
GIT_REF: ${{ github.ref }}
|
GIT_REF: ${{ github.ref }}
|
||||||
INPUT_TAG: ${{ github.event.inputs.tag || inputs.tag }}
|
INPUT_TAG: ${{ github.event.inputs.tag || inputs.tag || format('dev-{0}', github.sha) }}
|
||||||
SERVER_URL: ${{ github.server_url }}
|
SERVER_URL: ${{ github.server_url }}
|
||||||
REPOSITORY: ${{ github.repository }}
|
REPOSITORY: ${{ github.repository }}
|
||||||
run: node scripts/image-publication.mjs
|
run: node scripts/image-publication.mjs
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ export function imagePublication({ event, ref, inputTag, revision }) {
|
|||||||
|
|
||||||
let tag, channel;
|
let tag, channel;
|
||||||
if (event === "workflow_dispatch") {
|
if (event === "workflow_dispatch") {
|
||||||
tag = inputTag || `dev-${revision.slice(0, 7)}`;
|
tag = inputTag ?? "";
|
||||||
const commit = /^dev-([0-9a-f]{7,40})$/.exec(tag)?.[1];
|
const commit = /^dev-([0-9a-f]{7,40})$/.exec(tag)?.[1];
|
||||||
if (!commit || tag !== tag.trim())
|
if (!commit || tag !== tag.trim())
|
||||||
throw new Error(
|
throw new Error(
|
||||||
|
|||||||
Reference in new issue
Block a user