Skip to content
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

Figure out way for PRs from forks to work with static site generator #21

Open
LukeMondy opened this issue Sep 7, 2020 · 3 comments
Open

Comments

@LukeMondy
Copy link
Contributor

Relating to: #20

A possible solution is to switch back to pull_request_target, and do something like suggested here: #20 (comment) - that is, figure out what the real PR SHA is, and check that out manually.

The real issue is that forks can't see any github.SECRETS, which means the 'deploy the generated site to a git repo' doesn't work, and so we need a work around.

@lsf37
Copy link
Member

lsf37 commented Feb 3, 2021

I don't think there is a good GitHub solution for this, and the html-preview thing we are using currently has its own problems (takes sometimes extremely long to serve CSS or doesn't do it at all).

@wom-bat do you think it would be possible for the web server to host preview branches under a specific URL for a limited time?

So if we had a PR with some branch name x, the server would fetch x and serve it under something like stage.sel4.systems/x/. It could either monitor the GitHub repo directly for new pull requests or a GitHub action could poke some web hook to make it check out the repo.

We'd need to restrict this to PRs coming from org members, otherwise we'd be hosting arbitrary content on that preview. Maybe later extendable to some additional scheme similar to the ssrg-bamboo bot.

The preview branch should disappear from stage after the PR is merged or closed.

@lsf37
Copy link
Member

lsf37 commented Feb 3, 2021

This would also mean that we can run the validator and link checker on the live site and see their output in the error log, without needing to go through post processing and commenting, which keeps breaking.

@lsf37
Copy link
Member

lsf37 commented Apr 9, 2021

Another way to make the comment action work from forks is using a separate workflow for that part: https://docs.github.com/en/actions/reference/events-that-trigger-workflows#workflow_run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants