Skip to content

Commit

Permalink
Try to find the default_branch natively if not running on prs
Browse files Browse the repository at this point in the history
Wording fixups


Actually try to ind the branch naively if null


try to find the branch natively if no on prs
  • Loading branch information
sbe-arg committed Jan 4, 2023
1 parent 39d8e88 commit 2a3a10f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,20 @@ then
exit 0
fi

# sanitize that the default_branch is set (via env var when running on PRs) else find it natively
if [ -z "${default_branch}" ]
then
echo "The DEFAULT_BRANCH should be autodetected when tag-action runs on on PRs else must be defined, See: https://github.com/anothrNick/github-tag-action/pull/230, since is not defined we find it natively"
default_branch=$(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@')
echo "DEFAULT_BRANCH=${default_branch}"
# re check this
if [ -z "${default_branch}" ]
then
echo "::error::DEFAULT_BRANCH must not be null, something has gone wrong."
exit 1
fi
fi

# get the merge commit message looking for #bumps
declare -A history_type=(
["last"]="$(git show -s --format=%B)" \
Expand Down

0 comments on commit 2a3a10f

Please sign in to comment.