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

Change CI workflow triggers to pull_request #703

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jwright-stripe
Copy link

@jwright-stripe jwright-stripe commented Sep 29, 2024

Summary

This PR removes the pull_request_target from the GitHub Action workflow triggers.

Right now, by using pull_request_target, the workflow executes off the targeted branch. That is, if we got a PR that's trying to merge code into main, then the CI tests would actually run off the existing main branch, which isn't what we want!

But we also can't easily use a different trigger like pull_request. The issue is that these CI checks are meant to run end-to-end tests, making live requests using a dedicated Stripe test account. And secrets (reasonably!) aren't available to pull requests from forked repositories.

In terms of benefit/risks tradeoffs, we decided that the preferred option is to just run these tests on pushes to the main branch. We have this today, so the only change to make here was to remove the pull_request_target trigger.

In the process, I also updated our push trigger to filter on the relevant paths to prevent unnecessary workflows from being executed.

Rollout plan

After we merge this in, let's go have Dependabot rebase all the existing PR's / branches so everything is up-to-date.

@jwright-stripe jwright-stripe marked this pull request as ready for review September 30, 2024 15:20
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.

1 participant