Try with GITHUB_TOKEN

Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org>
This commit is contained in:
Martin Tzvetanov Grigorov 2025-06-03 15:40:40 +03:00
parent 5c14a25d5a
commit 693fcd5752
No known key found for this signature in database
GPG Key ID: 3194FD8C1AE300EF

View File

@ -4,22 +4,22 @@ on:
pull_request: pull_request:
types: [opened, synchronize, reopened, labeled, unlabeled] types: [opened, synchronize, reopened, labeled, unlabeled]
env:
GH_TOKEN: ${{ secrets.MEILI_BOT_GH_PAT }}
jobs: jobs:
check-labels: check-labels:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v3 uses: actions/checkout@v4
- name: Check db change labels - name: Check db change labels
id: check_labels id: check_labels
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: | run: |
URL=/repos/meilisearch/meilisearch/pulls/${{ github.event.pull_request.number }}/labels URL=/repos/meilisearch/meilisearch/pulls/${{ github.event.pull_request.number }}/labels
echo ${{ github.event.pull_request.number }} echo ${{ github.event.pull_request.number }}
echo $URL echo $URL
LABELS=$(gh api -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" /repos/meilisearch/meilisearch/issues/${{ github.event.pull_request.number }}/labels -q .[].name) LABELS=$(gh api -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" /repos/meilisearch/meilisearch/issues/${{ github.event.pull_request.number }}/labels -q .[].name)
echo "Labels: $LABELS"
if [[ ! "$LABELS" =~ "db change" && ! "$LABELS" =~ "no db change" ]]; then if [[ ! "$LABELS" =~ "db change" && ! "$LABELS" =~ "no db change" ]]; then
echo "::error::Pull request must contain either the 'db change' or 'no db change' label." echo "::error::Pull request must contain either the 'db change' or 'no db change' label."
exit 1 exit 1