Skip to content

Commit 3a20893

Browse files
authored
fix(ci): accept full tag name in workflow_dispatch, drop auto-v-prefix (#55)
Signed-off-by: lelia <lelia@socket.dev>
1 parent 6c213cd commit 3a20893

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

.github/workflows/publish-docker.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ on:
2020
workflow_dispatch:
2121
inputs:
2222
tag:
23-
description: "Version to publish without v prefix (e.g. 2.0.0). Must match an existing git tag."
23+
description: "Full git tag to publish (e.g. v2.0.0 for new releases, 1.1.3 for old). Must exist in the repo."
2424
required: true
2525

2626
# Default: deny everything. Each job below grants only what it needs.
@@ -42,17 +42,17 @@ jobs:
4242
steps:
4343
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
4444
with:
45-
ref: ${{ github.event_name == 'workflow_dispatch' && format('v{0}', inputs.tag) || github.ref }}
45+
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref }}
4646

4747
- name: 🏷️ Resolve version
4848
id: version
4949
run: |
5050
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
51-
CLEAN="${{ inputs.tag }}" # user provides without v prefix
51+
CLEAN="${{ inputs.tag }}" # full tag as provided (e.g. 1.1.3 or v2.0.0)
5252
else
5353
CLEAN="${{ github.ref_name }}" # e.g. v2.0.0
54-
CLEAN="${CLEAN#v}" # strip leading v → 2.0.0
5554
fi
55+
CLEAN="${CLEAN#v}" # strip leading v if present → 2.0.0 or 1.1.3
5656
echo "clean=$CLEAN" >> "$GITHUB_OUTPUT"
5757
5858
# ── Job 2: Build → test → push ─────────────────────────────────────────────

0 commit comments

Comments
 (0)