Skip to content

Commit

Permalink
Merge branch 'trunk' into fixed-header-custom-scroll
Browse files Browse the repository at this point in the history
  • Loading branch information
t-hamano committed Jan 20, 2024
2 parents 463b266 + a99575c commit 7692bde
Show file tree
Hide file tree
Showing 347 changed files with 7,433 additions and 3,158 deletions.
25 changes: 16 additions & 9 deletions bin/cherry-pick.mjs
Original file line number Diff line number Diff line change
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
Loading

0 comments on commit 7692bde

Please sign in to comment.