Skip to content

Commit

Permalink
ci: the current milestone ends after release day (#7922)
Browse files Browse the repository at this point in the history
## Summary

Ensure the PR check that blocks installs if the current milestone is for
maintenance doesn't think the milestone changed until after the release.
  • Loading branch information
benelan committed Oct 2, 2023
1 parent 8ba7827 commit ca611f2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .github/scripts/limitPullRequestsForMaintenanceReleases.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ module.exports = async ({ github, context, core }) => {
}

const currentDate = new Date(Date.now());

// make sure the milestone is still current on the day of the release
currentDate.setUTCHours(0, 0, 0, 0);

for (const milestone of milestones) {
if (!milestone?.due_on || new Date(milestone?.due_on) < currentDate) {
console.log(`Skipping open milestone "${milestone.title}" because it is past due or doesn't have a due date.`);
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/limit-prs-for-maintenance-releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Maintenance Release Merge Blocker
on:
pull_request:
branches: [main]
types: [labeled, unlabeled, synchronize]
types: [opened, labeled, unlabeled, synchronize]
jobs:
check-milestone:
runs-on: ubuntu-latest
Expand Down

0 comments on commit ca611f2

Please sign in to comment.