Skip to content

Commit 3944332

Browse files
authored
Fix update-examples workflow (#490)
1 parent 07ff016 commit 3944332

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

.github/workflows/update-examples.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@ on:
66
workflow_dispatch:
77
inputs:
88
old:
9-
description: 'Git ref of version to replace. Leave empty for auto-detect from git tags.'
9+
description: |
10+
git ref of version to be replaced with 'new'. Defaults to the first git tag lower than 'new' in v:refname sorting.
1011
required: false
1112
new:
12-
description: 'Branch or tag'
13-
required: true
13+
description: |
14+
git ref of version to replace 'old'. Defaults to the current git ref (github.ref_name).
15+
required: false
1416

1517
defaults:
1618
run:
@@ -28,9 +30,10 @@ jobs:
2830
- run: pip install -r .github/scripts/requirements.txt
2931
- name: 'Get versions'
3032
run: |
33+
old="${{ inputs.old }}"
3134
new="${{ inputs.new || github.ref_name }}"
3235
echo "NEW_VERSION=$new" | tee -a $GITHUB_ENV
33-
if [[ "${{ inputs.old }}" == "" ]]; then
36+
if [[ "$old" == "" ]]; then
3437
echo "Auto-detecting old version from git tags"
3538
# Get previous version from descending tag list
3639
old="$(git tag --sort=-v:refname | grep -A1 "$new" | tail -1)"

0 commit comments

Comments
 (0)