Skip to content

Commit

Permalink
Fixed crashing and causing issues when source branch has 'master' (ol…
Browse files Browse the repository at this point in the history
…d school) or 'main' (new repos) in its name.

It was causing errors like fatal: ambiguous argument 'master..test-master-name': unknown revision or path not in the working tree.
  • Loading branch information
ChristophShyper committed Feb 22, 2021
1 parent b839ffc commit 5b66164
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
phony: help

# Release tag for the action
VERSION := v0.1
VERSION := v0.2

# GitHub Actions bogus variables
GITHUB_REF ?= refs/heads/null
Expand Down
2 changes: 1 addition & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ if [[ $(git rev-parse --revs-only "${SOURCE_BRANCH}") == $(git rev-parse --revs-
fi

echo -e "\nComparing branches by diff"
if [[ -z $(git diff "${TARGET_BRANCH}..${SOURCE_BRANCH}") ]]; then
if [[ -z $(git diff "remotes/origin/${TARGET_BRANCH}..remotes/origin/${SOURCE_BRANCH}") ]]; then
echo -e "\n[INFO] Both branches are the same. No action needed."
exit 0
fi
Expand Down

0 comments on commit 5b66164

Please sign in to comment.