Skip to content

Commit ed0e11c

Browse files
committed
👷 Get commit message from tag or branch conditionally
1 parent a09c6fb commit ed0e11c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

.circleci/config.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ commands:
8484
steps:
8585
- run:
8686
name: 📑 Storing commit message
87-
command: git log origin/source -1 --oneline --pretty=%s > /home/circleci/GITMESSAGE.txt
87+
command: if [[ $CIRCLE_TAG =~ v(.+)(-source) ]]; then git fetch origin --tags; git log ${CIRCLE_TAG} -1 --oneline --pretty=%s > /home/circleci/GITMESSAGE.txt; else git log origin/${CIRCLE_BRANCH} -1 --oneline --pretty=%s > /home/circleci/GITMESSAGE.txt; fi
88+
8889
persist-new-build:
8990
steps:
9091
- persist_to_workspace:

0 commit comments

Comments
 (0)