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
251 stars 39 forks source link

Preview URL in comment doesn't match Enterprise deployment URL #82

Open thomas-noimos opened 4 months ago

thomas-noimos commented 4 months ago

I'm working on a private repo so I hope you not having access to it won't be an issue, but what I'm facing right now is that the comment gives me the following content:

Deployed preview to https://noimosai.github.io/noimos-ui-kit/pr-preview/pr-18/

However this link doesn't work and gives me a 404. I checked the gh-pages branch and the content is there. Apparently it is a new GitHub thing or I configured something wrong but my actual deployment is another URL:

https://friendly-adventure-lnjz19e.pages.github.io/ and I can access the preview content using the adapted URL https://friendly-adventure-lnjz19e.pages.github.io/pr-preview/pr-18/

Here is my config: image

Did I configure something wrong ?

thomas-noimos commented 4 months ago

Sorry I missed the docs where I could configure the custom-url prop, closing this.

rossjrw commented 4 months ago

Reopening this as a bug just in case. While I've not personally seen a *.pages.github.io before, it looks like that's what URLs for private enterprise repos look like (based on https://docs.github.com/en/enterprise-cloud@latest/pages/getting-started-with-github-pages/changing-the-visibility-of-your-github-pages-site#about-subdomains-for-privately-published-sites).

friendly-adventure-lnjz19e looks randomly-generated - is it permanent? Or does it ever change (over time, with each branch, etc)?

Does custom-url completely resolve the issue?

If all looks good, I'll leave this issue open as a documentation task as it'd be good to mention for enterprise users.

thomas-noimos commented 4 months ago

@rossjrw yes, using custom-url solved the issue. I completely removed the deployment and disabled GH pages, then enabled again and the randomly generated URL was the same after re-enabling it, so I guess it persists.

rossjrw commented 4 months ago

Works for me, thanks for the update!