-
Notifications
You must be signed in to change notification settings - Fork 4
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
Configure previews with access tokens and check out to fork #24
Conversation
|
A GitHub action was triggered, using this updated version. However, it didn't fail (there is no secret called |
I think the Can you make a small but visible change to see if things are working now? Or does this have to be on |
Sure! I will make a small change to test this. |
Yeah, it didn't work.
I mean, that's the name I assume exists. However, as explained, it has to be added to the environment. |
As an alternative, can you check whether preview works if the PR comes from a branch within this repo? I.e. not from your fork. Do you have the necessary rights to do create branches here? |
Alright! I will try this.
Yes, I can create a branch here. |
The preview didn't work. It shows the current main version of dmx. In my example that uses the same workflow file as the current version of dmx, it never checkouts to the fork, shows main instead. So it was expected to happen. However, a few important things:
I would still like to try the solution I did here because it will allow anybody to create previews when opening a PR, and help contribute. However, if it fails, we could discuss if it is worth it doing this now, and instead, try the easier strategy that will only work for those with access, and later come back to this task and fix this. The "bad" part then, is that many branches will be created in the main repo, but we could delete them. Nevertheless, we lose a bit of git history. |
BEGINRELEASENOTES
ENDRELEASENOTES
preview.yml
, the action never checked out to the PR, instead, it was to the same repo. However, I got confused when replicating, and thought It worked. After taking a closer look at my examples, I noticed that they never worked. This preview was supposed to show the changes, but instead showed the same repo again.To do that we need: a fine-grained access token, that allows us to have write access to
key4hep/dmx
(more info at docs and generate like this) and save this as a secret in the repo.@tmadlener or @kjvbrt should generate the token and add it as a secret inside an environment called
github-pages
(This one I think was already automatically generated). The token should be calledPR_TOKEN
. This setting is available at Settings > Environments > github-pages > Add environment secret.My working example has the main website and a preview using this same action file.