Closed electrofelix closed 1 year ago
Makes perfect sense to me and looks like a far better implementation of the .github.io detection. Will merge right away, thanks for the contribution!
Released in v1.3.2 https://github.com/rossjrw/pr-preview-action/releases/tag/v1.3.2
I'm using this action in https://github.com/vagrant-libvirt/vagrant-libvirt, unfortunately because the repo name matches the org name, the current behaviour of identifying repos for updating org gh-pages repos things that previews for the main application which should show up under https://vagrant-libvirt.github.io/vagrant-libvirt/ as though they should appear under https://vagrant-libvirt.github.io/
This can be seen with https://github.com/vagrant-libvirt/vagrant-libvirt/pull/1733#issuecomment-1518684270 which indicates the preview should appear as https://vagrant-libvirt.github.io/pr-preview/pr-1733/ when the correct URL is https://vagrant-libvirt.github.io/vagant-libvirt/pr-preview/pr-1733/
It appears this was caused by an improvement to try and generate the correct preview URLs for PRs in repos updating org pages https://github.com/rossjrw/pr-preview-action/blob/2a652922e9b9c53e7e5ea62fa38da744de09043c/action.yml#L68-L74
It appears that the code behaviour is expecting to match the following scenario:
Unfortunately it will also match on the following:
A simple fix should be to skip removal of the dot domain components:
will correctly skip outputting when
GITHUB_REPOSITORY="vagrant-libvirt/vagrant-libvirt"
while still detectingGITHUB_REPOSITORY="vagrant-libvirt/vagrant-libvirt.github.io"