From 8e7cc77ab9c1bffc233f2f3023d1b89ed44c9af5 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Sun, 26 Sep 2021 02:32:59 -0400 Subject: [PATCH] Fixed bug setting the server URL for github enterprise server (#198) * Update action.yml * Update entrypoint.sh * Update entrypoint.sh Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- action.yml | 3 ++- entrypoint.sh | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index 59c2a7fe..3c56e3cc 100644 --- a/action.yml +++ b/action.yml @@ -94,8 +94,9 @@ runs: id: changed-files shell: bash env: - GITHUB_BASE_REF: ${{ github.base_ref }} + GITHUB_SERVER_URL: ${{ github.server_url }} GITHUB_REPOSITORY: ${{ github.repository }} + GITHUB_BASE_REF: ${{ github.base_ref }} # INPUT_ is not available in Composite run steps # https://github.community/t/input-variable-name-is-not-available-in-composite-run-steps/127611 INPUT_SHA: ${{ inputs.sha }} diff --git a/entrypoint.sh b/entrypoint.sh index e227738e..4b2ce1c2 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -15,7 +15,9 @@ if [[ -n $INPUT_PATH ]]; then cd "$REPO_DIR" fi -git remote add temp_changed_files "https://${INPUT_TOKEN}@github.com/${GITHUB_REPOSITORY}" +SERVER_URL=$(echo "$GITHUB_SERVER_URL" | awk -F/ '{print $3}') + +git remote add temp_changed_files "https://${INPUT_TOKEN}@${SERVER_URL}/${GITHUB_REPOSITORY}" echo "Getting HEAD info..."