Skip to content

Commit 815cc8b

Browse files
committed
workflow: pyz: target specified tag
1 parent d44cf9d commit 815cc8b

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

.github/workflows/build-pyz.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Build PYZ distribution
22

3-
run-name: ${{ github.event.release.tag_name || inputs.head-sha || github.event.workflow_run.display_title }}
3+
run-name: ${{ github.event.release.tag_name || inputs.head-ref || github.event.workflow_run.display_title }}
44

55
on:
66
release:
@@ -15,7 +15,7 @@ on:
1515

1616
workflow_dispatch:
1717
inputs:
18-
head-sha:
18+
head-ref:
1919
default: ""
2020
required: false
2121
type: string
@@ -58,16 +58,21 @@ jobs:
5858
id: head
5959
if: fromJSON(steps.success.outputs.can-build)
6060
env:
61-
HEAD_SHA: ${{ inputs.head-sha }}
61+
HEAD_REF: ${{ inputs.head-ref }}
6262
RUN_SHA: ${{ github.event.workflow_run.head_sha }}
6363
run: |
64-
TARGET_SHA=${HEAD_SHA:-$RUN_SHA}
64+
if [ -n "$HEAD_REF" ]
65+
then
66+
TARGET_REF="${HEAD_REF}^"
67+
else
68+
TARGET_REF="$RUN_SHA"
69+
fi
6570
66-
HEAD="$(git log --format=%H ${TARGET_SHA}.. | tail -n 1)"
71+
HEAD="$(git log --format=%H ${TARGET_REF}.. | tail -n 1)"
6772
6873
if [ -z "$HEAD" ]
6974
then
70-
echo "::error::could not find publish workflow changeset following ${TARGET_SHA:0:9}"
75+
echo "::error::could not find publish workflow changeset following ${TARGET_REF:0:9}"
7176
exit 1
7277
fi
7378
@@ -77,7 +82,7 @@ jobs:
7782
7883
if [ -z "$TAGS" ]
7984
then
80-
echo "::error::changeset following ${TARGET_SHA:0:9} does not appear to be tagged release: ${HEAD:0:9}"
85+
echo "::error::changeset following ${TARGET_REF:0:9} does not appear to be tagged release: ${HEAD:0:9}"
8186
exit 1
8287
fi
8388

0 commit comments

Comments
 (0)