From 1cf4ee2af3c0be3f341701037a159b6465ce4a80 Mon Sep 17 00:00:00 2001 From: Ivan Dyachkov Date: Thu, 24 Apr 2025 13:32:49 +0200 Subject: [PATCH] ci: ensure milestone is set on PRs --- .github/workflows/pr-checks.yaml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/pr-checks.yaml diff --git a/.github/workflows/pr-checks.yaml b/.github/workflows/pr-checks.yaml new file mode 100644 index 000000000..529eeac48 --- /dev/null +++ b/.github/workflows/pr-checks.yaml @@ -0,0 +1,21 @@ +name: PR Checks + +on: + pull_request: + +jobs: + pr-checks: + runs-on: ubuntu-latest + steps: + - name: Ensure milestone is set on the PR + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + id: check_milestone + run: | + PR_MILESTONE=$(gh --repo ${{ github.repository }} pr view ${{ github.event.pull_request.number }} --json milestone --jq '.milestone.title') + if [ -z "$PR_MILESTONE" ]; then + echo "No milestone set on the PR. Please set a milestone before merging." + exit 1 + else + echo "Milestone is set to: $PR_MILESTONE" + fi