Skip to content

Commit

Permalink
fix: check out correct branch on pull_request events (#244)
Browse files Browse the repository at this point in the history
* fix: check out correct branch on pull_request events

* fix: work with tags event
  • Loading branch information
georeith committed Sep 6, 2024
1 parent 6ed209d commit 215ab1c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,11 @@ push_to_branch() {
git config --global user.email "${INPUT_GITHUB_USER_EMAIL}"
git config --global user.name "${INPUT_GITHUB_USER_NAME}"

if [ "$INPUT_SKIP_REF_CHECKOUT" != true ] && [ ${GITHUB_REF#refs/heads/} != $GITHUB_REF ]; then
git checkout "${GITHUB_REF#refs/heads/}"
if [ "$INPUT_SKIP_REF_CHECKOUT" != true ]; then
CHECKOUT=${GITHUB_HEAD_REF:-${GITHUB_REF}}
CHECKOUT=${CHECKOUT#refs/heads/}
CHECKOUT=${CHECKOUT#refs/tags/}
git checkout "${CHECKOUT}"
fi

if [ -n "$(git show-ref refs/heads/${BRANCH})" ]; then
Expand Down

0 comments on commit 215ab1c

Please sign in to comment.