Skip to content

Commit

Permalink
Merge pull request rossjrw#11 from hungelabs/main
Browse files Browse the repository at this point in the history
Update action to work with user/organization sites
  • Loading branch information
rossjrw authored and aidanheerdegen committed Oct 25, 2022
1 parent 59e77e4 commit 5f11048
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,16 @@ runs:
echo "targetdir=$umbrella/pr-$pr" >> "$GITHUB_ENV"
echo "pr=$pr" >> "$GITHUB_ENV"
pagesurl=$(echo $GITHUB_REPOSITORY | sed 's/\//.github.io\//')
echo "pagesurl=$pagesurl" >> "$GITHUB_ENV"
org=$(echo "$GITHUB_REPOSITORY" | cut -d "/" -f 1)
thirdleveldomain=$(echo "$GITHUB_REPOSITORY" | cut -d "/" -f 2 | cut -d "." -f 1)
if [ "$org" == "$thirdleveldomain" ]; then
pagesurl="${org}.github.io"
else
pagesurl=$(echo "$GITHUB_REPOSITORY" | sed 's/\//.github.io\//')
fi
echo "pagesurl=$pagesurl" >> $GITHUB_ENV
echo "emptydir=$(mktemp -d)" >> "$GITHUB_ENV"
echo "datetime=$(date '+%Y-%m-%d %H:%M %Z')" >> "$GITHUB_ENV"
Expand Down

0 comments on commit 5f11048

Please sign in to comment.