diff --git a/tools/@aws-cdk/project-sync/lib/github.ts b/tools/@aws-cdk/project-sync/lib/github.ts index fe469c553aa02..7b90d0f13867c 100644 --- a/tools/@aws-cdk/project-sync/lib/github.ts +++ b/tools/@aws-cdk/project-sync/lib/github.ts @@ -216,7 +216,7 @@ export class Github { query { repository(owner: "${REPOSITORY_OWNER}", name: "${REPOSITORY}") { projectV2(number: ${project}) { - items(first: 100 ${cursor ? `, after: "${cursor}"` : ''}) { + items(first: 50 ${cursor ? `, after: "${cursor}"` : ''}) { pageInfo { hasNextPage endCursor diff --git a/tools/@aws-cdk/project-sync/lib/issue-sync.ts b/tools/@aws-cdk/project-sync/lib/issue-sync.ts index 811d221d12eec..b2fec5e7fe131 100644 --- a/tools/@aws-cdk/project-sync/lib/issue-sync.ts +++ b/tools/@aws-cdk/project-sync/lib/issue-sync.ts @@ -1,6 +1,6 @@ import { Github } from './github.js'; import { PROJECT_NUMBER, REPOSITORY } from './config.js'; -import { projectIds, getPriorityFromLabels } from './utils.js'; +import { projectIds, getPriorityFromLabels, isBotLogin } from './utils.js'; export const syncIssue = async (issue: string) => { const github = Github.default(); @@ -49,7 +49,7 @@ export const syncIssueData = async (issueDetails: any) => { for (let index = 0; index < timelineItems.length; index++) { const item = timelineItems[timelineItems.length-index-1]; - if (item?.createdAt !== undefined && item.author?.login !== 'github-actions' && item.actor?.login !== 'github-actions') { + if (item?.createdAt !== undefined && !isBotLogin(item.author?.login) && !isBotLogin(item.actor?.login)) { updateDate = new Date(item.createdAt); break; } diff --git a/tools/@aws-cdk/project-sync/lib/pr-sync.ts b/tools/@aws-cdk/project-sync/lib/pr-sync.ts index 499546aa80bbb..308a1bdbb7b5c 100644 --- a/tools/@aws-cdk/project-sync/lib/pr-sync.ts +++ b/tools/@aws-cdk/project-sync/lib/pr-sync.ts @@ -1,6 +1,6 @@ import { Github } from './github.js'; import { PROJECT_NUMBER, REPOSITORY } from './config.js'; -import { projectIds, getPriorityFromLabels } from './utils.js'; +import { projectIds, getPriorityFromLabels, isBotLogin } from './utils.js'; export const syncPr = async (pr: string) => { const github = Github.default(); @@ -49,7 +49,8 @@ export const syncPrData = async (prDetails: any) => { for (let index = 0; index < timelineItems.length; index++) { const item = timelineItems[timelineItems.length-index-1]; - if (item?.createdAt !== undefined && item.author?.login !== 'github-actions' && item.actor?.login !== 'github-actions' && item.commit?.author?.user?.login !== 'github-actions') { + if (item?.createdAt !== undefined && !isBotLogin(item.author?.login) + && !isBotLogin(item.actor?.login) && !isBotLogin(item.commit?.author?.user?.login) ) { updateDate = new Date(item.createdAt ?? item.commit.committedDate); break; } diff --git a/tools/@aws-cdk/project-sync/lib/utils.ts b/tools/@aws-cdk/project-sync/lib/utils.ts index f32a9fbe6bc1e..184a68d17bb68 100644 --- a/tools/@aws-cdk/project-sync/lib/utils.ts +++ b/tools/@aws-cdk/project-sync/lib/utils.ts @@ -104,3 +104,10 @@ export const getPriorityFromLabels = (labels: any[], priorityField: { options: R } return undefined; }; + +const botLogins = new Set([ + 'github-actions', + 'related-issues-bot-for-aws', +]); + +export const isBotLogin = (login: string) => botLogins.has(login);