accept-a-payment
accept-a-payment copied to clipboard
Auto merge Dependabot PRs
Resolves stripe-samples/accept-a-payment#1195
Hi. I made changes to automerge.yml
so that it auto-merge only when the CI of a Dependabot's PR is successfully completed.
The changes below are a little irrelevant to the original issue but needed to work CI and tests correctly:
- Fixed typo (
ref/heads/main
->refs/heads/main
): by this fix, pushes to the main branch should trigger CI runs. - Fixed tests: it seems the redirect URL from Stripe has been changed and caused CI failures.
- original: checkout.stripe.com/pay/cs_test
- changed: checkout.stripe.com/c/pay/cs_test
The changes to the original PR
I have applied changes to the original PR (commit: 3401fad). Let me explain it.
Before applying this change, on an auto-merge workflow run page, it was difficult to figure out which CI triggered the auto-merge (example on my fork). Also, on an auto-merged Depeendabot PR page, there was no reference to the auto-merge workflow run (example on my fork).
I think that is a little confusing and this is the motivation for the changes.
To make it easier to trace the whole workflow, I moved the job in the automerge.yml
into ci.yml
. With this change, we can see the relationship between the tests and auto-merge on the workflow summary page like this:
A working example
I tested this on my fork repository. The working example is this:
- The pull request: https://github.com/hibariya/accept-a-payment/pull/1031
- The workflow run: https://github.com/hibariya/accept-a-payment/actions/runs/3254365963
Let me close this PR for now and re-open another one to remove a couple of irrelevant changes here :pray: