accept-a-payment icon indicating copy to clipboard operation
accept-a-payment copied to clipboard

Auto merge Dependabot PRs

Open hibariya opened this issue 2 years ago • 1 comments

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

hibariya avatar Oct 10 '22 22:10 hibariya

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:

image

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

hibariya avatar Oct 15 '22 05:10 hibariya

Let me close this PR for now and re-open another one to remove a couple of irrelevant changes here :pray:

hibariya avatar Nov 23 '22 05:11 hibariya