Unverified Commit 2d660290 authored by Wolfgang Walther's avatar Wolfgang Walther
Browse files

ci/github-script/merge: improve testability

By only ignoring already-handled comments when running non-dry, it's
much easier to look at existing PRs, for which the merge bot already
commented, and iterate on them locally.

It's dry mode anyway, so it won't hurt to get a few more merge comments
in the console output.
parent 747d9e2d
Loading
Loading
Loading
Loading
+9 −8
Original line number Diff line number Diff line
@@ -168,6 +168,7 @@ async function handleMerge({
      // Ignore comments where the user has been deleted already.
      user &&
      // Ignore comments which had already been responded to by the bot.
      (dry ||
        !events.some(
          ({ event, body }) =>
            ['commented'].includes(event) &&
@@ -175,7 +176,7 @@ async function handleMerge({
            // We'll just assume that nobody creates comments with this marker on purpose.
            // Additionally checking the author is quite annoying for local debugging.
            body.match(new RegExp(`^<!-- comment: ${node_id} -->$`, 'm')),
      ),
        )),
  )

  async function merge() {