Default manual image builds to dev-<commit> when no tag is given
A manual run with an empty tag input failed validation. It now uses the checked-out commit's short SHA, and the workflow input is optional. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
b33725adfa
commit
727f5b0261
2 files changed
+4
-4
No files matched your search
@@ -6,8 +6,8 @@ on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag:
|
||||
description: "dev-<commit SHA> (7-40 lowercase hex characters, matching the selected source)"
|
||||
required: true
|
||||
description: "dev-<commit SHA> (7-40 lowercase hex characters, matching the selected source); empty uses the checked-out commit"
|
||||
required: false
|
||||
type: string
|
||||
|
||||
permissions:
|
||||
@@ -35,7 +35,7 @@ jobs:
|
||||
env:
|
||||
EVENT_NAME: ${{ github.event_name }}
|
||||
GIT_REF: ${{ github.ref }}
|
||||
INPUT_TAG: ${{ github.event.inputs.tag }}
|
||||
INPUT_TAG: ${{ github.event.inputs.tag || inputs.tag }}
|
||||
SERVER_URL: ${{ github.server_url }}
|
||||
REPOSITORY: ${{ github.repository }}
|
||||
run: node scripts/image-publication.mjs
|
||||
|
||||
@@ -9,7 +9,7 @@ export function imagePublication({ event, ref, inputTag, revision }) {
|
||||
|
||||
let tag, channel;
|
||||
if (event === "workflow_dispatch") {
|
||||
tag = inputTag ?? "";
|
||||
tag = inputTag || `dev-${revision.slice(0, 7)}`;
|
||||
const commit = /^dev-([0-9a-f]{7,40})$/.exec(tag)?.[1];
|
||||
if (!commit || tag !== tag.trim())
|
||||
throw new Error(
|
||||
|
||||
Reference in new issue
Block a user