From 727f5b026163cc085a71bdbb0b37399b1defec1d Mon Sep 17 00:00:00 2001 From: kawa Date: Sun, 18 Oct 2026 01:15:14 +0200 Subject: [PATCH] Default manual image builds to dev- 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 --- .gitea/workflows/publish-image.yml | 6 +++--- scripts/image-publication.mjs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/publish-image.yml b/.gitea/workflows/publish-image.yml index 4e8203f..d1d5273 100644 --- a/.gitea/workflows/publish-image.yml +++ b/.gitea/workflows/publish-image.yml @@ -6,8 +6,8 @@ on: workflow_dispatch: inputs: tag: - description: "dev- (7-40 lowercase hex characters, matching the selected source)" - required: true + description: "dev- (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 diff --git a/scripts/image-publication.mjs b/scripts/image-publication.mjs index 3073104..706b3be 100644 --- a/scripts/image-publication.mjs +++ b/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(