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

How to allow testing from forks? #33

Open
luxas opened this issue Aug 20, 2020 · 4 comments
Open

How to allow testing from forks? #33

luxas opened this issue Aug 20, 2020 · 4 comments

Comments

@luxas
Copy link
Collaborator

luxas commented Aug 20, 2020

#32 illustrates that Github Actions doesn't "leak" secrets in this repo (for the testing bot) to PRs from forks.
Let's figure out how to allow PRs to be tested with the bot secret enabled.

@luxas luxas added this to the v0.0.3 milestone Aug 20, 2020
@michaelbeaumont
Copy link
Contributor

Yeah we've struggled with this, it's a pretty nasty shortcoming IMO. Ultimately I suppose there needs to be a step built into github like "trust this PR". Nothing related appears on the roadmap unfortunately.

@luxas luxas modified the milestones: v0.0.3, v0.0.4 Aug 20, 2020
@stefanprodan
Copy link
Member

This could help https://twitter.com/hamelhusain/status/1294307330096394241?s=21

@michaelbeaumont
Copy link
Contributor

michaelbeaumont commented Aug 21, 2020

Nice, this actually solves the problems I was having straight away, I only wanted to merge PRs so didn't need the fork code at all.
It looks like with pull_request_target the base branch workflow is run with base branch code. However, I think by writing a workflow that first, for example, checks for a comment or a label on the PR, i.e. the trust step, and then checks out the fork code, it can be used to run tests with secrets too.

@nab-gha
Copy link
Contributor

nab-gha commented Mar 25, 2021

From my reading of the docs pull_request_target seems to make it run the tests against head of the base repo rather than the PR? This prevents malicious code being run but does not test the PR changes, which seems to defeat the point of the workflow.

@stefanprodan stefanprodan removed this from the v0.0.5 milestone Apr 29, 2021
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

4 participants