Conversation
…fail with permissions errors
statasaurus
left a comment
There was a problem hiding this comment.
This looks amazing! Do you think it is ready to be pulled in? I am not totally sure we need to add if about excluding forks. At this point a good chunk of our PR's are from people outside the repo and this guidance leaves me to believe that forks will need approval to run anyway
|
@statasaurus We can set it up so that it runs on forks, but the logic in the yaml is just because it will error at the moment as the pr preview action itself doesn't support running on forks (see this build) I can look into setting this up so it won't works on PRs from forks if you're happy with the security risk. As you've said, we can just set it so that PRs from forks require approval to run, currently I think the default is that approval is needed the first time but not after that, may want to change it so it's a little stricter? That will mean this change takes longer to finish, as I'll have to write a new version of the action, and we'll have to do some faffing with gh tokens. It may be easiest to merge this change as the next best thing, then I can look at extending the functionality to forks in the future? |
This PR updates the Pull Request and Deployment actions to allow for previews of the PR deployments.
It uses the action https://github.com/marketplace/actions/deploy-pr-preview, which I've called at the end of
.github/workflows/pull_request_action.yml. This will upload the_sitedirectory from the PR rendering output to a new/pr-preview/pull-<n>directory of thegh-pagesbranch, and create a sticky comment in the PR that links to this preview section of the site.There is an example pull request for this at michaelwalshe#1.
A couple of notes about this change:
Happy to discuss further, this is only a sample implementation!