Skip to content

Commit 8517ef7

Browse files
committed
chore: update version workflow to allow manual version input and fix version retrieval using tag
1 parent 22ac9f4 commit 8517ef7

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

.github/workflows/update_version.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,20 @@ on:
44
release:
55
types: [published]
66
workflow_dispatch:
7+
inputs:
8+
version:
9+
description: 'Version to use (leave empty to use latest release)'
10+
required: false
11+
type: string
712

813
permissions:
914
contents: read
1015

1116
jobs:
1217
update-version:
1318
runs-on: ubuntu-latest
19+
outputs:
20+
version: ${{ steps.get_version.outputs.version }}
1421
permissions:
1522
contents: write
1623
pull-requests: write
@@ -23,10 +30,12 @@ jobs:
2330
- name: Get version
2431
id: get_version
2532
run: |
26-
if [ "${{ github.event_name }}" = "release" ]; then
33+
if [ -n "${{ inputs.version }}" ]; then
34+
VERSION="${{ inputs.version }}"
35+
elif [ "${{ github.event_name }}" = "release" ]; then
2736
VERSION="${{ github.event.release.tag_name }}"
2837
else
29-
VERSION=$(gh release list --limit 1 --json tagName -q '.[0].tagName')
38+
VERSION=$(git describe --tags --abbrev=0)
3039
fi
3140
3241
# Remove 'v' prefix if present

0 commit comments

Comments
 (0)