From b57b1040f5d1ee0889eae8308b7321feacac5735 Mon Sep 17 00:00:00 2001 From: Chiara Marmo Date: Tue, 6 Apr 2021 16:36:57 +0200 Subject: [PATCH 1/7] Add a check for milestones. --- .github/workflows/check-milestone.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/check-milestone.yml diff --git a/.github/workflows/check-milestone.yml b/.github/workflows/check-milestone.yml new file mode 100644 index 0000000000000..f9630acabb927 --- /dev/null +++ b/.github/workflows/check-milestone.yml @@ -0,0 +1,26 @@ +name: Check Milestone +# This check makes sure that the changelog is properly updated +# when a PR introduces a change in a test file. +# To bypass this check, label the PR with "No Changelog Needed". +on: + pull_request: + types: [opened, edited, labeled, unlabeled, synchronize] + +jobs: + check: + runs-on: ubuntu-latest + if: ${{ contains(github.event.pull_request.labels.*.name, 'Long Term') == 0 }} + steps: + - name: Get PR number and milestone + run: | + echo "PR_NUMBER=${{ github.event.pull_request.number }}" >> $GITHUB_ENV + echo "TAGGED_MILESTONE=${{ github.event.pull_request.milestone.title }}" >> $GITHUB_ENV + - uses: actions/checkout@v2 + with: + fetch-depth: '0' + - name: Check the milestone + run: | + set -xe + if [ $TAGGED_MILESTONE == "" ] + echo "No milestone has been set." + exit 1 From 8be5b672d582c1d5eb71b0d0a8ca533c20eedf60 Mon Sep 17 00:00:00 2001 From: Chiara Marmo Date: Tue, 6 Apr 2021 17:06:46 +0200 Subject: [PATCH 2/7] Trig the check. From 0059f8867cbbb74c1d51e16408f17eb9fcfb3ad5 Mon Sep 17 00:00:00 2001 From: Chiara Marmo Date: Tue, 6 Apr 2021 17:09:21 +0200 Subject: [PATCH 3/7] Fix syntax error. --- .github/workflows/check-milestone.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/check-milestone.yml b/.github/workflows/check-milestone.yml index f9630acabb927..59a9547e2d6f8 100644 --- a/.github/workflows/check-milestone.yml +++ b/.github/workflows/check-milestone.yml @@ -24,3 +24,4 @@ jobs: if [ $TAGGED_MILESTONE == "" ] echo "No milestone has been set." exit 1 + From b90e10a12cf1420efaa4148faa034646fe99673a Mon Sep 17 00:00:00 2001 From: Chiara Marmo Date: Tue, 6 Apr 2021 17:11:38 +0200 Subject: [PATCH 4/7] Fix syntax error. --- .github/workflows/check-milestone.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/check-milestone.yml b/.github/workflows/check-milestone.yml index 59a9547e2d6f8..7964c68e45bc9 100644 --- a/.github/workflows/check-milestone.yml +++ b/.github/workflows/check-milestone.yml @@ -22,6 +22,8 @@ jobs: run: | set -xe if [ $TAGGED_MILESTONE == "" ] + then echo "No milestone has been set." exit 1 + fi From bac5129e2ec659017ea5e618e6b78f67b5268a0e Mon Sep 17 00:00:00 2001 From: Chiara Marmo Date: Wed, 7 Apr 2021 11:01:13 +0200 Subject: [PATCH 5/7] Fix comment --- .github/workflows/check-milestone.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/check-milestone.yml b/.github/workflows/check-milestone.yml index 7964c68e45bc9..74927d3e19dde 100644 --- a/.github/workflows/check-milestone.yml +++ b/.github/workflows/check-milestone.yml @@ -1,7 +1,6 @@ name: Check Milestone -# This check makes sure that the changelog is properly updated -# when a PR introduces a change in a test file. -# To bypass this check, label the PR with "No Changelog Needed". +# This check makes sure that the milestone is properly set. +# To bypass this check, label the PR with "Long Term". on: pull_request: types: [opened, edited, labeled, unlabeled, synchronize] From 34ec0909eac4473189ccde25c3e301a8deecca99 Mon Sep 17 00:00:00 2001 From: Chiara Marmo Date: Wed, 7 Apr 2021 16:32:22 +0200 Subject: [PATCH 6/7] Remove unuseful steps. --- .github/workflows/check-milestone.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/workflows/check-milestone.yml b/.github/workflows/check-milestone.yml index 74927d3e19dde..31adf404cc3ca 100644 --- a/.github/workflows/check-milestone.yml +++ b/.github/workflows/check-milestone.yml @@ -10,17 +10,10 @@ jobs: runs-on: ubuntu-latest if: ${{ contains(github.event.pull_request.labels.*.name, 'Long Term') == 0 }} steps: - - name: Get PR number and milestone - run: | - echo "PR_NUMBER=${{ github.event.pull_request.number }}" >> $GITHUB_ENV - echo "TAGGED_MILESTONE=${{ github.event.pull_request.milestone.title }}" >> $GITHUB_ENV - - uses: actions/checkout@v2 - with: - fetch-depth: '0' - name: Check the milestone run: | set -xe - if [ $TAGGED_MILESTONE == "" ] + if [ ${{ github.event.pull_request.milestone.title }} == "" ] then echo "No milestone has been set." exit 1 From a14a07c61a8976a9aec242e3adfb34fcb9b0c3b9 Mon Sep 17 00:00:00 2001 From: Chiara Marmo Date: Wed, 7 Apr 2021 19:33:40 +0200 Subject: [PATCH 7/7] Clarify the need of triage --- .github/workflows/check-milestone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-milestone.yml b/.github/workflows/check-milestone.yml index 31adf404cc3ca..6b71a62dd5740 100644 --- a/.github/workflows/check-milestone.yml +++ b/.github/workflows/check-milestone.yml @@ -1,4 +1,4 @@ -name: Check Milestone +name: Check Milestone (when failing needs Triage intervention) # This check makes sure that the milestone is properly set. # To bypass this check, label the PR with "Long Term". on: