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

[CI&CD] Fix CI runs for PRs from forks #875

Merged
merged 1 commit into from
May 29, 2023
Merged

Conversation

radeknovis
Copy link
Contributor

@radeknovis radeknovis commented May 26, 2023

More context here: https://iterative.ai/blog/testing-external-contributions-using-github-actions-secrets

NB: This is complicated to test as it needs to be merged in main first, so it is split in two parts leaving original ci workflow unchanged

name: ci_v2

on:
pull_request_target:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Runs triggered using this event have access to secrets.

environment:
${{ (github.event_name == 'pull_request_target' &&
github.event.pull_request.head.repo.full_name != github.repository) &&
'external' || 'internal' }}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This external vs internal environment would differentiate between regular PRs and PRs incoming from forks and we can require approval and we can specify that external ones need approval before running.

@radeknovis radeknovis changed the title Try using pull_request_target to allow access to secrets when approved [CI&CD] Fix CI runs for PRs from forks May 26, 2023
@radeknovis radeknovis merged commit 6c486a7 into develop May 29, 2023
@radeknovis radeknovis deleted the allow-external-PRs branch May 29, 2023 07:55
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

Successfully merging this pull request may close these issues.

2 participants