mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-03-09 09:31:32 +01:00
update the CI to enforce the db change label on PR
This commit is contained in:
parent
ba7970b548
commit
c67ba9e237
25
.github/workflows/db-change.yml
vendored
Normal file
25
.github/workflows/db-change.yml
vendored
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
name: Check db change labels
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
types: [opened, synchronize, reopened, labeled, unlabeled]
|
||||||
|
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.MEILI_BOT_GH_PAT }}
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
check-labels:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Check db change labels
|
||||||
|
id: check_labels
|
||||||
|
run: |
|
||||||
|
LABELS=$(gh api -H "Accept: application/vnd.github.v3+json" /repos/meilisearch/meilisearch/pulls/${{ github.event.pull_request.number }}/labels -q .[].name)
|
||||||
|
if [[ ! "$LABELS" =~ "db change" && ! "$LABELS" =~ "no db change" ]]; then
|
||||||
|
echo "::error::Pull request must contain either the 'db change' or 'no db change' label."
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
echo "The label is set"
|
||||||
|
fi
|
Loading…
x
Reference in New Issue
Block a user