Merge pull request #2343 from vrm-c/Santarh-patch-1

Update Label Checker
This commit is contained in:
Masataka SUMI
2024-07-04 15:32:44 +09:00
committed by GitHub

View File

@@ -13,31 +13,12 @@ permissions:
statuses: write
jobs:
ready-deploy:
check-label:
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
- name: Failed 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\"."
}'
echo "::error::Please label \"Breaking changes\" or \"Non breaking changes\"."
exit 1