Skip to content

Commit

Permalink
remove successful and stale PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
bherrmann2 committed Jul 9, 2024
1 parent 4a3a2d4 commit 57d81ac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/helpers/remove-pr-from-merge-queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ export const removePrFromMergeQueue = async ({ seconds }: RemovePrFromMergeQueue
ref: sha,
...context.repo
});
const failingStatus = data.find(status => status.state === 'failure');
if (failingStatus && timestampIsStale(failingStatus.created_at, seconds)) {
const status = data.find(status => status.state === 'failure' || status.state === 'success');
if (status && timestampIsStale(status.created_at, seconds)) {
core.info('Removing stale PR from first queued position...');
return Promise.all([removeLabelIfExists(READY_FOR_MERGE_PR_LABEL, number), removeLabelIfExists(FIRST_QUEUED_PR_LABEL, number)]);
}
Expand Down

0 comments on commit 57d81ac

Please sign in to comment.