rossjrw / pr-preview-action

GitHub Action that deploys a pull request preview to GitHub Pages, similar to Vercel and Netlify, and cleans up after itself.
https://github.com/marketplace/actions/deploy-pr-preview
MIT License
267 stars 43 forks source link

Incompatible with GitHub github.io convention #22

Closed aidanheerdegen closed 1 year ago

aidanheerdegen commented 1 year ago

It seems that pr-preview-action is incompatible with the GitHub convention of naming the repository <org/user>.github.io where GitHub serves the pages with the website root at the origin of the site from the repo, rather than adding the repo name as the first path in the URL.

In particular this line

https://github.com/rossjrw/pr-preview-action/blob/main/action.yml#L63

just inserts github.io between the organisation name and the repo name. So I get

Screen Shot 2022-10-21 at 2 38 38 pm

as the preview URL. Everything else works fine, and I can edit the url so it is correct, but clearly in this case the logic is incorrect. I'm half convinced I must be missing something, because this is a long standing convention which I was sure the tool should understand.

I'm guessing some simple logic of checking if the repo name is already ends with <org/user>.github.io might be sufficient, in which case pagesurl should just be the .

aidanheerdegen commented 1 year ago

I should have said, love the plugin! Previews are a fantastic feature, alleviating the necessity for everyone to install all the infrastructure to build a website. Thanks.

rossjrw commented 1 year ago

Hi @aidanheerdegen, thanks for the report. This should be fixed as of #11 (https://github.com/rossjrw/pr-preview-action/releases/tag/v1.2.0). Closing this issue, but please re-open if there are any problems.