From 4454354827b0c76ad05818e929a98f52c0b5a9fe Mon Sep 17 00:00:00 2001 From: Gabriel Dos Santos Date: Thu, 26 Mar 2026 15:51:11 -0400 Subject: [PATCH 1/3] Make milestone independent of qa/skip-qa --- .github/workflows/pr-linter.yml | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/.github/workflows/pr-linter.yml b/.github/workflows/pr-linter.yml index faf73e91f..78f2b043c 100644 --- a/.github/workflows/pr-linter.yml +++ b/.github/workflows/pr-linter.yml @@ -3,7 +3,7 @@ on: pull_request_target: types: [opened, labeled, unlabeled, synchronize] pull_request: - types: [opened, labeled, unlabeled, synchronize, milestoned, demilestoned] + types: [opened, labeled, unlabeled, synchronize] permissions: {} @@ -24,21 +24,3 @@ jobs: valid-labels: 'bug, enhancement, refactoring, documentation, tooling, dependencies' pull-request-number: '${{ github.event.pull_request.number }}' disable-reviews: true - check-milestone: - name: Check Milestone - if: github.event_name == 'pull_request' - runs-on: ubuntu-latest - permissions: - pull-requests: read - steps: - - name: Check milestone and labels - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - PR_JSON=$(gh api repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}) - MILESTONE=$(echo "$PR_JSON" | jq -r '.milestone.title // empty') - HAS_SKIP_QA=$(echo "$PR_JSON" | jq -r '[.labels[].name] | any(. == "qa/skip-qa")') - if [ -z "$MILESTONE" ] && [ "$HAS_SKIP_QA" != "true" ]; then - echo "::error::Missing milestone or \`qa/skip-qa\` label" - exit 1 - fi From 7e891b380f0970883f0ca59bf1ebd9cc090e8015 Mon Sep 17 00:00:00 2001 From: Gabriel Dos Santos Date: Thu, 26 Mar 2026 15:51:49 -0400 Subject: [PATCH 2/3] Add post merge milestone workflow --- .github/workflows/add-milestone.yml | 59 +++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 .github/workflows/add-milestone.yml diff --git a/.github/workflows/add-milestone.yml b/.github/workflows/add-milestone.yml new file mode 100644 index 000000000..7f41c966b --- /dev/null +++ b/.github/workflows/add-milestone.yml @@ -0,0 +1,59 @@ +name: Add Milestone on a Merged PR + +on: + pull_request: + types: + - closed + branches: + - main + - "v[0-9]+.[0-9]+" + +permissions: {} + +jobs: + add-milestone-pr: + name: Add Milestone on PR + if: github.event.pull_request.merged == true + runs-on: ubuntu-latest + permissions: + pull-requests: write + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_REPO: ${{ github.repository }} + steps: + - name: Get current milestone from branch + id: current-milestone + run: | + BASE_BRANCH="${{ github.base_ref }}" + + if [[ "$BASE_BRANCH" == "main" ]]; then + # For main, use the open milestone with the highest creation order (latest upcoming release). + MILESTONE=$(gh api repos/${{ github.repository }}/milestones \ + --jq '[.[] | select(.state == "open")] | sort_by(.number) | last | .title') + elif [[ "$BASE_BRANCH" =~ ^v([0-9]+)\.([0-9]+)$ ]]; then + # For release branches like v1.25, derive the milestone as v1.25.0. + MILESTONE="v${BASH_REMATCH[1]}.${BASH_REMATCH[2]}.0" + else + echo "Error: Unexpected branch '$BASE_BRANCH'." + exit 1 + fi + + if [ -z "$MILESTONE" ]; then + echo "Error: Couldn't determine a current milestone for branch '$BASE_BRANCH'." + exit 1 + fi + + if [[ ! $MILESTONE =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo "Error: Malformed milestone '$MILESTONE'. It should be of the form 'vX.Y.Z'." + exit 1 + fi + + echo "MILESTONE=$MILESTONE" >> "$GITHUB_OUTPUT" + + - name: Set the merged PR milestone to current milestone + run: | + echo "Setting milestone $MILESTONE to PR $NUMBER." + gh issue edit "$NUMBER" --milestone "$MILESTONE" + env: + NUMBER: ${{ github.event.number }} + MILESTONE: ${{ steps.current-milestone.outputs.MILESTONE }} From eb0c76c989db82526787069b69199c98c1545af2 Mon Sep 17 00:00:00 2001 From: Gabriel Dos Santos Date: Thu, 26 Mar 2026 16:11:31 -0400 Subject: [PATCH 3/3] Update PR Template --- .github/PULL_REQUEST_TEMPLATE.md | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index cfa75d650..c2df9728d 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -24,7 +24,6 @@ Write there any instructions and details you may have to test your PR. ### Checklist - [ ] PR has at least one valid label: `bug`, `enhancement`, `refactoring`, `documentation`, `tooling`, and/or `dependencies` -- [ ] PR has a milestone or the `qa/skip-qa` label - [ ] All commits are signed (see: [signing commits][1]) [1]: https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits \ No newline at end of file