From 430e3dfc1de8a8ae77e77d862d25676ef9db55d1 Mon Sep 17 00:00:00 2001 From: Ross Williams Date: Tue, 17 Sep 2024 14:29:22 +0100 Subject: [PATCH] Hardcode this action's URL to github.com Resolves bug on enterprise instances where this action would appear to originate from the instance (#82) --- action.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/action.yml b/action.yml index f30a003..39b7bf4 100644 --- a/action.yml +++ b/action.yml @@ -87,13 +87,13 @@ runs: echo "targetdir=$umbrella/pr-$pr" >> $GITHUB_ENV echo "pr=$pr" >> $GITHUB_ENV - org=$(echo "$deployrepo" | cut -d "/" -f 1) - thirdleveldomain=$(echo "$deployrepo" | cut -d "/" -f 2) + repo_org=$(echo "$deployrepo" | cut -d "/" -f 1) + repo_name=$(echo "$deployrepo" | cut -d "/" -f 2) if [ ! -z "$customurl" ]; then pagesurl="$customurl" - elif [ "${org}.github.io" == "$thirdleveldomain" ]; then - pagesurl="${org}.github.io" + elif [ "${repo_org}.github.io" == "$repo_name" ]; then + pagesurl="${repo_org}.github.io" else pagesurl=$(echo "$deployrepo" | sed 's/\//.github.io\//') fi @@ -144,7 +144,7 @@ runs: header: pr-preview message: "\ [PR Preview Action]\ - (${{ github.server_url }}/${{ env.actionrepo }}) + (https://github.com/${{ env.actionrepo }}) ${{ env.action_version }} :---: @@ -177,7 +177,7 @@ runs: header: pr-preview message: "\ [PR Preview Action]\ - (${{ github.server_url }}/${{ env.actionrepo }}) + (https://github.com/${{ env.actionrepo }}) ${{ env.action_version }} :---: