Add authorize job which requires externally created PRs to be approve… #883
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR enables the concept of approving externally created PRs for running e2e tests. It is based on a blog post : https://datachain.ai/blog/testing-external-contributions-using-github-actions-secrets
The setup involved here is first we create two environments: external and internal. The external environment will have a deployment protection rule enabled which will require a review from anyone on the team. This PR introduces a job called "authorize" which only runs after approval if the PR originates from a fork. Then, the e2e test jobs are marked as needing the authorize job to complete prior to running. In this way users on the team can still run e2e tests from either forked or unforked PRs since we can approve the job.
Here is an example of the protection in action:
Here's an example of a PR which is not forked:
For forked PRs from team members the flow will be the same as the first example but we can self approve the job run.
Resolves https://github.com/k0rdent/2a-internal/issues/17