Skip to content

Commit

Permalink
fix: Add support for GitHub Enterprise Server based on PR commitizen-…
Browse files Browse the repository at this point in the history
…tools#52 by a-bertroud
  • Loading branch information
apollosfire committed Mar 28, 2023
1 parent 50fc9d7 commit 5d93055
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,12 @@ fi
echo "REVISION=${REV}" >>"$GITHUB_ENV"
echo "version=${REV}" >>"$GITHUB_OUTPUT"

GITHUB_DOMAIN=${GITHUB_SERVER_URL#*//}
CURRENT_BRANCH="$(git branch --show-current)"
INPUT_BRANCH="${INPUT_BRANCH:-$CURRENT_BRANCH}"
INPUT_REPOSITORY="${INPUT_REPOSITORY:-$GITHUB_REPOSITORY}"


echo "Repository: ${INPUT_REPOSITORY}"
echo "Actor: ${GITHUB_ACTOR}"

Expand All @@ -94,7 +96,7 @@ if [[ $INPUT_PUSH == 'true' ]]; then
echo "You probably want to run on push to your default branch instead." >&2
else
echo "Pushing to branch..."
REMOTE_REPO="https://${GITHUB_ACTOR}:${INPUT_GITHUB_TOKEN}@github.com/${INPUT_REPOSITORY}.git"
REMOTE_REPO="https://${GITHUB_ACTOR}:${INPUT_GITHUB_TOKEN}@${GITHUB_DOMAIN}/${INPUT_REPOSITORY}.git"
git pull "$REMOTE_REPO" "$INPUT_BRANCH"
git push "$REMOTE_REPO" "HEAD:${INPUT_BRANCH}" --tags
fi
Expand Down

0 comments on commit 5d93055

Please sign in to comment.