Skip to content

Commit 84607f1

Browse files
committed
move tag check earlier
1 parent e431da4 commit 84607f1

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

.github/workflows/create_archive_and_notes.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ set -o errexit
1919

2020
set -x
2121

22+
TAG=$1
23+
if [ -z "$TAG" ]; then
24+
echo "ERROR: TAG env var must be set"
25+
exit 1
26+
fi
2227
# Exclude dot directories, specifically, this file so that we don't
2328
# find the substring we're looking for in our own file.
2429
# Exclude CONTRIBUTING.md, RELEASING.md because they document how to use these strings.
@@ -35,14 +40,10 @@ if [[ $grep_exit_code -eq 0 ]]; then
3540
exit 1
3641
fi
3742

38-
TAG=$1
39-
if [ -z "$TAG" ]; then
40-
echo "ERROR: TAG env var must be set"
41-
exit 1
42-
fi
4343
# A prefix is added to better match the GitHub generated archives.
4444
PREFIX="rules_python-${TAG}"
4545
ARCHIVE="rules_python-$TAG.tar.gz"
46+
# If the workflow checks out one commit, but is releasing another
4647
git fetch origin tag "$TAG"
4748
git archive --format=tar "--prefix=${PREFIX}/" "$TAG" | gzip > "$ARCHIVE"
4849
SHA=$(shasum -a 256 "$ARCHIVE" | awk '{print $1}')

0 commit comments

Comments
 (0)