Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Copy Markdown
Contributor Author

@georeith georeith Sep 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this check: [ ${GITHUB_REF#refs/heads/} != $GITHUB_REF ] was trying to prevent a git checkout error that would occur if this ran on an event type (e.g., pull_request) whose GITHUB_REF is not set to refs/heads/head.

and should be unnecessary now as this should always be able to resolve to a value that can be checked out

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