diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8ed342fea..52480247e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,6 +3,7 @@ on: workflow_dispatch: null push: pull_request: + types: [opened, synchronize, reopened, labeled, unlabeled] jobs: docker-build: runs-on: ubuntu-latest @@ -58,6 +59,18 @@ jobs: - name: run linter run: make lint + - name: Check Merge Readiness + if: github.event_name == 'pull_request' + run: | + LABELS='${{ toJson(github.event.pull_request.labels.*.name) }}' + + if echo "$LABELS" | grep -q "do-not-merge"; then + echo "This PR is labeled as 'do-not-merge' so please make sure it is ready." + exit 1 + else + exit 0 + fi + unit-tests-on-ubuntu: runs-on: ubuntu-latest strategy: diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 394ec5de9..ae22dada4 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -1,4 +1,4 @@ -name: labeler +name: Labeler on: push: @@ -16,11 +16,10 @@ jobs: labeler: runs-on: ubuntu-latest steps: - - - name: Checkout + - name: Checkout uses: actions/checkout@v7 - - - name: Run Labeler + + - name: Run Labeler uses: crazy-max/ghaction-github-labeler@548a7c3603594ec17c819e1239f281a3b801ab4d with: github-token: ${{ secrets.GITHUB_TOKEN }}