From 5b661647d50432af0d1de02bdfe92ae126ea5181 Mon Sep 17 00:00:00 2001 From: Krzysztof Szyper Date: Mon, 22 Feb 2021 10:22:05 +0100 Subject: [PATCH] Fixed crashing and causing issues when source branch has 'master' (old 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. --- Makefile | 2 +- entrypoint.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index b37480a..741aa21 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/entrypoint.sh b/entrypoint.sh index 536836d..8ae8e4c 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -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