Fixed broken links - 2026.03 #18040
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: 'Release Milestone Check' | |
| on: | |
| pull_request_target: | |
| types: | |
| - opened | |
| - reopened | |
| - synchronize | |
| - labeled | |
| - unlabeled | |
| - milestoned | |
| - demilestoned | |
| jobs: | |
| check-release-milestone: | |
| name: Check Release Milestone | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| ref: master | |
| path: './' | |
| - id: version | |
| run: | | |
| echo "version=$(cat ./VERSION)" >> $GITHUB_OUTPUT | |
| - name: Block merge if release milestone is missing | |
| uses: actions/github-script@v8 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| script: | | |
| const nextMinorRegex = /^(v[0-9]+\.[0-9]+)\.0-dev/gmi; | |
| let match = nextMinorRegex.exec('${{ steps.version.outputs.version }}'); | |
| if (match == null) { | |
| core.info('VERSION does not indicate that the next version is a new minor release - skipping check'); | |
| return; | |
| } | |
| const nextMinorVersion = match[1]; | |
| // Fetch current PR data to get latest milestone info | |
| const { data: pullRequest } = await github.rest.pulls.get({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| pull_number: context.payload.pull_request.number | |
| }); | |
| const milestones = await github.rest.issues.listMilestones({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| state: 'open', | |
| sort: 'due_on', | |
| direction: 'desc' | |
| }); | |
| let milestoneForNextMinorReleaseFound = false; | |
| for (const milestone of milestones.data) { | |
| if (milestone.title != nextMinorVersion) { | |
| continue; | |
| } | |
| // milestone found, check if PR is associated | |
| milestoneForNextMinorReleaseFound = true; | |
| if (pullRequest.milestone == null) { | |
| core.setFailed('Milestone for next minor release ' + nextMinorVersion + ' found, however, PR is not milestoned for it. Merge is not allowed.'); | |
| return | |
| } | |
| // Check if milestone matches | |
| if (pullRequest.milestone.title != nextMinorVersion) { | |
| core.setFailed('PR has milestone "' + pullRequest.milestone.title + '" but should have "' + nextMinorVersion + '". Merge is not allowed.'); | |
| return | |
| } | |
| } | |
| if (milestoneForNextMinorReleaseFound) { | |
| core.info('Milestone for next minor release ' + nextMinorVersion + ' found and PR is milestoned for it. Merge is allowed.'); | |
| } else { | |
| core.info('Milestone for next minor release ' + nextMinorVersion + ' not found. Merge is allowed.'); | |
| } | |