Skip to content

Commit

Permalink
Update to rossjrw#24 to limit mismatches for org pages
Browse files Browse the repository at this point in the history
When the repository matches the org name, which might be slightly more
common for small OSS projects where the owner wishes to move to using an
org to allow it be managed by other contributors over time, the existing
code will assume this means it is for the org level pages.

Consequently updates to a repo such as vagrant-libvirt/vagrant-libvirt
will have it's preview URL using the org style rather than the
repository style.

This change adjust the matching to limit to only allowing repos of the
name `<org>.github.io` to be presented with the org style gh-pages
preview URL.

Fixes: rossjrw#39
  • Loading branch information
electrofelix committed Apr 22, 2023
1 parent 2a65292 commit 9130fdf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ runs:
echo "pr=$pr" >> $GITHUB_ENV
org=$(echo "$GITHUB_REPOSITORY" | cut -d "/" -f 1)
thirdleveldomain=$(echo "$GITHUB_REPOSITORY" | cut -d "/" -f 2 | cut -d "." -f 1)
thirdleveldomain=$(echo "$GITHUB_REPOSITORY" | cut -d "/" -f 2)
if [ ! -z "$customurl" ]; then
pagesurl="$customurl"
elif [ "$org" == "$thirdleveldomain" ]; then
elif [ "${org}.github.io" == "$thirdleveldomain" ]; then
pagesurl="${org}.github.io"
else
pagesurl=$(echo "$GITHUB_REPOSITORY" | sed 's/\//.github.io\//')
Expand Down

0 comments on commit 9130fdf

Please sign in to comment.