Skip to content

Commit ef37af0

Browse files
committed
Hot fix: fetch the tag object into the GitHub workflow
Signed-off-by: Johannes Schindelin <[email protected]>
1 parent bfa1ca0 commit ef37af0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

.github/workflows/release-tag.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,14 @@ jobs:
3737
tag_name=${GITHUB_REF#refs/tags/}
3838
test "x$GITHUB_REF" != "x$tag_name" || die "Not a tag: $GITHUB_REF"
3939
40+
# `actions/checkout` only downloads the peeled tag (i.e. the commit)
41+
git fetch origin +$GITHUB_REF:$GITHUB_REF
42+
4043
train="$(echo "$tag_name" | sed -n 's|^\(v[0-9][0-9]*\)[.0-9]*$|\1|p')"
4144
test -n "$train" || die "Unexpected tag name: $tag_name"
4245
echo "$train" >train
4346
44-
if train_rev="$(git rev-parse --verify "refs/remotes/origin/$train")"
47+
if train_rev="$(git rev-parse --verify "refs/remotes/origin/$train" 2>/dev/null)"
4548
then
4649
test 0 -eq "$(git rev-list --count "$GITHUB_REF..$train_rev")" ||
4750
die "Branch '$train' does not fast-forward to tag '$tag_name'"

0 commit comments

Comments
 (0)