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.
This commit is contained in:
@@ -168,6 +168,7 @@ async function handleMerge({
|
|||||||
// Ignore comments where the user has been deleted already.
|
// Ignore comments where the user has been deleted already.
|
||||||
user &&
|
user &&
|
||||||
// Ignore comments which had already been responded to by the bot.
|
// Ignore comments which had already been responded to by the bot.
|
||||||
|
(dry ||
|
||||||
!events.some(
|
!events.some(
|
||||||
({ event, body }) =>
|
({ event, body }) =>
|
||||||
['commented'].includes(event) &&
|
['commented'].includes(event) &&
|
||||||
@@ -175,7 +176,7 @@ async function handleMerge({
|
|||||||
// We'll just assume that nobody creates comments with this marker on purpose.
|
// We'll just assume that nobody creates comments with this marker on purpose.
|
||||||
// Additionally checking the author is quite annoying for local debugging.
|
// Additionally checking the author is quite annoying for local debugging.
|
||||||
body.match(new RegExp(`^<!-- comment: ${node_id} -->$`, 'm')),
|
body.match(new RegExp(`^<!-- comment: ${node_id} -->$`, 'm')),
|
||||||
),
|
)),
|
||||||
)
|
)
|
||||||
|
|
||||||
async function merge() {
|
async function merge() {
|
||||||
|
|||||||
Reference in New Issue
Block a user