Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
{
"data": {
"repository": {
"id": "MDEwOlJlcG9zaXRvcnk2MDkzMzE2",
"pullRequest": {
"id": "PR_kwDOAFz6BM7aQ8jd",
"title": "just Update package.json",
"createdAt": "2026-05-11T13:20:01Z",
"author": {
"login": "justinkrn68-droid",
"__typename": "User"
},
"authorAssociation": "FIRST_TIME_CONTRIBUTOR",
"baseRef": {
"name": "master",
"__typename": "Ref"
},
"labels": {
"nodes": [],
"__typename": "LabelConnection"
},
"isDraft": false,
"mergeable": "MERGEABLE",
"number": 74980,
"state": "OPEN",
"headRefOid": "c6d1344b3c7e49f62f4befd1aaa8665eb6bd6864",
"baseRefOid": "84efd8820459db1cdaad122f2347683b7db023ee",
"changedFiles": 0,
"additions": 0,
"deletions": 0,
"commitIds": {
"totalCount": 1,
"nodes": [
{
"commit": {
"oid": "c6d1344b3c7e49f62f4befd1aaa8665eb6bd6864",
"parents": {
"nodes": [
{
"oid": "84efd8820459db1cdaad122f2347683b7db023ee",
"__typename": "Commit"
}
],
"__typename": "CommitConnection"
},
"__typename": "Commit"
},
"__typename": "PullRequestCommit"
}
],
"__typename": "PullRequestCommitConnection"
},
"timelineItems": {
"nodes": [],
"__typename": "PullRequestTimelineItemsConnection"
},
"reviews": {
"totalCount": 0,
"nodes": [],
"__typename": "PullRequestReviewConnection"
},
"commits": {
"totalCount": 1,
"nodes": [
{
"commit": {
"checkSuites": {
"nodes": [
{
"databaseId": 68415365071,
"app": {
"name": "GitHub Actions",
"__typename": "App"
},
"conclusion": "ACTION_REQUIRED",
"resourcePath": "/DefinitelyTyped/DefinitelyTyped/commit/c6d1344b3c7e49f62f4befd1aaa8665eb6bd6864/checks?check_suite_id=68415365071",
"status": "COMPLETED",
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped/commit/c6d1344b3c7e49f62f4befd1aaa8665eb6bd6864/checks?check_suite_id=68415365071",
"checkRuns": {
"nodes": [],
"__typename": "CheckRunConnection"
},
"createdAt": "2026-05-11T13:20:11Z",
"workflowRun": {
"databaseId": 25672723099,
"file": {
"path": ".github/workflows/CI.yml",
"__typename": "WorkflowRunFile"
},
"__typename": "WorkflowRun"
},
"__typename": "CheckSuite"
}
],
"__typename": "CheckSuiteConnection"
},
"status": null,
"authoredDate": "2026-05-11T13:19:36Z",
"committedDate": "2026-05-11T13:19:36Z",
"pushedDate": null,
"oid": "c6d1344b3c7e49f62f4befd1aaa8665eb6bd6864",
"__typename": "Commit"
},
"__typename": "PullRequestCommit"
}
],
"__typename": "PullRequestCommitConnection"
},
"comments": {
"totalCount": 0,
"nodes": [],
"__typename": "IssueCommentConnection"
},
"files": {
"totalCount": 0,
"nodes": [],
"pageInfo": {
"hasNextPage": false,
"endCursor": "MQ",
"__typename": "PageInfo"
},
"__typename": "PullRequestChangedFileConnection"
},
"projectItems": {
"nodes": [],
"__typename": "ProjectV2ItemConnection"
},
"__typename": "PullRequest"
},
"__typename": "Repository"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "remove",
"now": "2026-06-09T18:11:33.900Z",
"message": "PR has no edited files",
"isDraft": false,
"shouldClose": true
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[
{
"mutation": "mutation ($input: ClosePullRequestInput!) {\n closePullRequest(input: $input) {\n __typename\n }\n}",
"variables": {
"input": {
"pullRequestId": "PR_kwDOAFz6BM7aQ8jd"
}
}
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"labels": [],
"responseComments": [],
"shouldClose": true,
"shouldMerge": false,
"shouldUpdateLabels": false,
"projectColumn": "*REMOVE*"
}
1 change: 1 addition & 0 deletions packages/mergebot/src/compute-pr-actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ export function process(prInfo: BotResult, extendedCallback: (info: ExtendedPrIn
return {
...createEmptyActions(),
projectColumn: prInfo.isDraft ? "Needs Author Action" : "*REMOVE*",
shouldClose: !!prInfo.shouldClose,
};
}

Expand Down
7 changes: 5 additions & 2 deletions packages/mergebot/src/pr-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ interface BotEnsureRemovedFromProject {
readonly now: Date;
readonly message: string;
readonly isDraft: boolean;
readonly shouldClose?: boolean;
}

export interface PackageInfo {
Expand Down Expand Up @@ -216,6 +217,7 @@ export async function deriveStateForPR(

if (prInfo.isDraft) return botEnsureRemovedFromProject("PR is a draft");
if (prInfo.state !== "OPEN") return botEnsureRemovedFromProject("PR is not active");
if (prInfo.changedFiles === 0) return botEnsureRemovedFromProject("PR has no edited files", true);

const headCommit = getHeadCommit(prInfo);
// eslint-disable-next-line eqeqeq
Expand Down Expand Up @@ -316,8 +318,9 @@ export async function deriveStateForPR(
return { type: "error", now, message, author: prInfo.author?.login };
}

function botEnsureRemovedFromProject(message: string): BotEnsureRemovedFromProject {
return { type: "remove", now, message, isDraft: prInfo.isDraft };
function botEnsureRemovedFromProject(message: string, shouldClose = false): BotEnsureRemovedFromProject {
const base: BotEnsureRemovedFromProject = { type: "remove", now, message, isDraft: prInfo.isDraft };
return shouldClose ? { ...base, shouldClose: true } : base;
}
}

Expand Down