Skip to content

Commit

Permalink
Merge branch 'trunk' into border-control-toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
mirka committed Jan 24, 2024
2 parents 4cdb215 + 80b25d3 commit 85389d8
Show file tree
Hide file tree
Showing 611 changed files with 16,633 additions and 17,632 deletions.
25 changes: 16 additions & 9 deletions bin/cherry-pick.mjs
Expand Up @@ -10,7 +10,7 @@ const LABEL = process.argv[ 2 ] || 'Backport to WP Beta/RC';
const BRANCH = getCurrentBranch();
const GITHUB_CLI_AVAILABLE = spawnSync( 'gh', [ 'auth', 'status' ] )
?.stdout?.toString()
.includes( '✓ Logged in to github.com as' );
.includes( '✓ Logged in to github.com' );

const AUTO_PROPAGATE_RESULTS_TO_GITHUB = GITHUB_CLI_AVAILABLE;

Expand Down Expand Up @@ -114,16 +114,23 @@ async function fetchPRs() {
const { items } = await GitHubFetch(
`/search/issues?q=is:pr state:closed sort:updated label:"${ LABEL }" repo:WordPress/gutenberg`
);
const PRs = items.map( ( { id, number, title, pull_request, closed_at } ) => ( {
id,
number,
title,
pull_request,
} ) )
const PRs = items
.map( ( { id, number, title, pull_request, closed_at } ) => ( {
id,
number,
title,
pull_request,
} ) )
.filter( ( { pull_request } ) => !! pull_request?.merged_at )
.sort( ( a, b ) => new Date( a?.pull_request?.merged_at ) - new Date( b?.pull_request?.merged_at ) );
.sort(
( a, b ) =>
new Date( a?.pull_request?.merged_at ) -
new Date( b?.pull_request?.merged_at )
);

console.log( 'Found the following PRs to cherry-pick (sorted by closed date in ascending order): ' );
console.log(
'Found the following PRs to cherry-pick (sorted by closed date in ascending order): '
);
PRs.forEach( ( { number, title } ) =>
console.log( indent( `#${ number }${ title }` ) )
);
Expand Down

0 comments on commit 85389d8

Please sign in to comment.