-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't post preview comment until actual GitHub Pages deployment workflow completed? #25
Comments
Good idea! Off the top of my head, I don't think this action can get any information about the Pages build process itself. This is definitely worth spending some time looking into - thanks for the contribution! |
Yeah, there doesn't seem to be a way to programmatically get info about the process at all. Maybe one of these endpoints can accept the Actions token as authentication? https://docs.github.com/en/rest/pages#get-latest-pages-build Since users of this action can't customize the text in the pr comment, I'd strongly request tweaking the wording carefully so people inexperienced with GitHub won't get confused. |
I strongly agree here and I really like the addition you added that says "once GitHub finishes deploying it". I think this would reduce a lot of confusion |
I think this endpoint could be used: You can pass this argument:
|
I've added a 'when github finishes deploying it'-like text to the default comment in v1.6.0 (#97). I'll be honest, the reason I let your suggestion languish for so long was because I didn't think it was really necessary, even though it was obviously a good idea and you even cited real user experience; until I had that exact same moment of thinking the action was broken while working on 97. The URL is just e.g. https://github.com/rossjrw/pr-preview-action/deployments - not super specific, but enough to let a user know that something is happening and enough to let a more advanced user find out exactly what, without needing any real effort to try to find the right workflow log. Not going to close this issue because I'd still like to (have an option to?) have the action wait for the deployment to actually finish before it posts its comment. Suggestion for myself: current comment text before deployment has finished, wait for deployment, edit comment to indicate that it finished. If comment:false, don't post either comment, but still delay action completion until the deployment is done. |
Testing this out, and it works great! One thing I noticed is that, understandably, the action only waits for itself to finish to post the comment on the pull request. It would be great if that could somehow be delayed until the actual GitHub Pages deployment process has completed so that the preview link works as soon as it's posted. Right now, there's a short period of time between when the comment is posted and when the link will actually go somewhere.
I'm using this action in a website template that will be used by many non-technical users, and I could see them getting confused by there being a link but the preview not being ready yet.
As for how to implement this, I'm not sure. Is it possible for this Action to somehow add the associated GitHub Pages deployment run as a Status Check to the PR? Maybe it's possible to use action-wait-for-check or some similar action to wait for the deployment to succeed in the middle of running this action (I guess after committing to the
gh-pages
branch so the build starts, but before returning successfully).Or maybe a stop gap could simply be adding a message to the pull request comment that clarifies that the preview WILL be available (after a short moment) at the following link.
gh-pages
at 2022-11-21 20:33 UTCThe text was updated successfully, but these errors were encountered: