Skip to content

Commit

Permalink
Merge pull request #12 from 13rac1/skip-master
Browse files Browse the repository at this point in the history
fix: Abort on master branch
  • Loading branch information
13rac1 authored Jan 22, 2020
2 parents d6c88e9 + cea0a64 commit b9734a3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ main() {
BRANCH=${GITHUB_REF:11}
echo "Current branch: ${BRANCH}"

if [ "$BRANCH" == "master" ]; then
echo "No check of master branch needed."
exit 0
fi

# Using git directly because the $GITHUB_EVENT_PATH file only shows commits in
# most recent push.
/usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin master
if [ "$BRANCH" != "master" ]; then
/usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --shallow-exclude=master origin ${BRANCH}
fi

/usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --shallow-exclude=master origin ${BRANCH}

# Get the list before the "|| true" to fail the script when the git cmd fails.
FIXUP_LIST=`/usr/bin/git log --pretty=format:%s origin/master..origin/${BRANCH}`
Expand Down

0 comments on commit b9734a3

Please sign in to comment.