Skip to content

Commit 69ba0c0

Browse files
committed
only release from branch main or master
1 parent 6e4e807 commit 69ba0c0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Earthfile

+6-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,12 @@ build-and-release-on-github:
2121
RUN apt-get update >/dev/null 2>&1 && apt-get -y install gh >/dev/null 2>&1
2222
COPY .git .git
2323
COPY +build/target target
24-
RUN --push export release_timestamp=$(date '+%Y-%m-%d @ %H:%M'); \
24+
RUN --push export BRANCH=$(git rev-parse --abbrev-ref HEAD); \
25+
if [ "$BRANCH" != "main" -a "$BRANCH" != "master" ]; then \
26+
echo "not releasing, we're on branch $BRANCH"; \
27+
exit 0; \
28+
fi; \
29+
export release_timestamp=$(date '+%Y-%m-%d @ %H:%M'); \
2530
export release_timestamp_terse=$(date '+%Y-%m-%d-%H-%M'); \
2631
export release_hash_short=$(git rev-parse --short HEAD); \
2732
export release_hash=$(git rev-parse HEAD); \

0 commit comments

Comments
 (0)