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: "Dev - PR Label Checker" | |
| on: | |
| pull_request: | |
| branches: | |
| - develop | |
| types: | |
| - reopened | |
| - synchronize | |
| - labeled | |
| - unlabeled | |
| - milestoned | |
| - demilestoned | |
| jobs: | |
| check_labels: | |
| name: "Check Dev PR Labels" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: mheap/github-action-required-labels@v5 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| mode: exactly | |
| count: 1 | |
| labels: "bug, documentation, enhancement, task" | |
| - name: Check Milestone | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| # Get the PR information | |
| PR_MILESTONE=$(gh pr view ${{ github.event.pull_request.number }} --json milestone --jq '.milestone.title' || echo "null") | |
| # If the milestone is null, fail the workflow | |
| if [ "$PR_MILESTONE" == "" ]; then | |
| echo "❌ The pull request does not have a milestone assigned." | |
| exit 1 | |
| fi | |
| # Output the milestone if it exists | |
| echo "✅ The pull request has a milestone assigned: $PR_MILESTONE." |