Skip to content

Commit

Permalink
chore: move release check to a standalone file
Browse files Browse the repository at this point in the history
  • Loading branch information
JackuB committed Feb 15, 2021
1 parent 0567ef3 commit fc3db6e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
10 changes: 1 addition & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -325,15 +325,7 @@ jobs:
# docker_layer_caching: true
- run:
name: Should I release?
command: |
echo "Considering these commits:"
git --no-pager log $(git describe --tags --abbrev=0 @^)..@ --pretty=format:'%s' --no-merges
echo "\n---\nChecking for feat, fix or revert commit"
git log $(git describe --tags --abbrev=0 @^)..@ --pretty=format:'%s' --no-merges | grep -Ei "^(feat|fix|revert)"
if [ "$?" = "1" ]; then
echo "No changes to release, stopping"
circleci-agent step halt
fi
command: ./release-scripts/should-i-release.sh
- install_github_cli
- run:
name: Install npm@7
Expand Down
16 changes: 16 additions & 0 deletions release-scripts/should-i-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash

# Look at commit messages and stop the release job if it's not needed

echo "Considering these commits:"
git --no-pager log "$(git describe --tags --abbrev=0 @^)"..@ --pretty=format:'- %s %H' --no-merges

echo " "
echo "---"
echo "Checking for a feat, fix or revert commit message"

git log "$(git describe --tags --abbrev=0 @^)"..@ --pretty=format:'%s' --no-merges | grep -Ei "^(feat|fix|revert)"
if [ "$?" = "1" ]; then
echo "No changes to release, stopping"
circleci-agent step halt
fi

0 comments on commit fc3db6e

Please sign in to comment.