From fec460e1c2bd057171952df40143dadf5c4e2870 Mon Sep 17 00:00:00 2001 From: Masataka SUMI Date: Wed, 3 Jul 2024 20:45:41 +0900 Subject: [PATCH 1/2] Create label_checker.yml --- .github/workflows/label_checker.yml | 43 +++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/label_checker.yml diff --git a/.github/workflows/label_checker.yml b/.github/workflows/label_checker.yml new file mode 100644 index 000000000..7b1743171 --- /dev/null +++ b/.github/workflows/label_checker.yml @@ -0,0 +1,43 @@ +name: Breaking changes label checker + +on: + pull_request: + types: + - synchronize + - labeled + - unlabeled + - opened + - reopened + +permissions: + statuses: write + +jobs: + ready-deploy: + runs-on: ubuntu-latest + name: Breaking changes label checker + steps: + - name: Pass if labeled + if: "contains(github.event.pull_request.labels.*.name, 'Breaking changes') || contains(github.event.pull_request.labels.*.name, 'Non breaking changes')" + run: | + curl --request POST \ + --url https://api.github.com/repos/${{github.repository}}/statuses/${{github.event.pull_request.head.sha}} \ + --header 'authorization: Bearer ${{secrets.GITHUB_TOKEN}}' \ + --header 'content-type: application/json' \ + --data '{ + "context": "Breaking changes label checker", + "state": "success", + "description": "Already labeled. Thank you." + }' + - name: Pending if not labeled + if: "!(contains(github.event.pull_request.labels.*.name, 'Breaking changes') || contains(github.event.pull_request.labels.*.name, 'Non breaking changes'))" + run: | + curl --request POST \ + --url https://api.github.com/repos/${{github.repository}}/statuses/${{github.event.pull_request.head.sha}} \ + --header 'authorization: Bearer ${{secrets.GITHUB_TOKEN}}' \ + --header 'content-type: application/json' \ + --data '{ + "context": "Breaking changes label checker"", + "state": "pending", + "description": "Please label \"Breaking changes\" or \"Non Breaking changes\"." + }' From 567e8b76f3489e4d04b7247cf9c8f0b21fbb7421 Mon Sep 17 00:00:00 2001 From: Masataka SUMI Date: Wed, 3 Jul 2024 20:51:45 +0900 Subject: [PATCH 2/2] Update label_checker.yml --- .github/workflows/label_checker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/label_checker.yml b/.github/workflows/label_checker.yml index 7b1743171..c7a100d44 100644 --- a/.github/workflows/label_checker.yml +++ b/.github/workflows/label_checker.yml @@ -37,7 +37,7 @@ jobs: --header 'authorization: Bearer ${{secrets.GITHUB_TOKEN}}' \ --header 'content-type: application/json' \ --data '{ - "context": "Breaking changes label checker"", + "context": "Breaking changes label checker", "state": "pending", "description": "Please label \"Breaking changes\" or \"Non Breaking changes\"." }'