From 7b1e610cc7a4ac0cdd16842b66642a9de36661fe Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Tue, 3 Dec 2024 17:46:37 -0500 Subject: [PATCH] ci: move PR body check to a different workflow Move PR body check to a workflow that monitors editing of PRs. Avoids rerunnin compliance check and other heavy weights workflows on just an edit of the PR body. Signed-off-by: Anas Nashif --- .github/workflows/compliance.yml | 8 -------- .github/workflows/do_not_merge.yml | 20 ++++++++++++++++++-- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/.github/workflows/compliance.yml b/.github/workflows/compliance.yml index 559e315d587..e6e8389b222 100644 --- a/.github/workflows/compliance.yml +++ b/.github/workflows/compliance.yml @@ -65,14 +65,6 @@ jobs: west config manifest.group-filter -- +ci,-optional west update -o=--depth=1 -n 2>&1 1> west.update.log || west update -o=--depth=1 -n 2>&1 1> west.update2.log - - name: Check for PR description - if: ${{ github.event.pull_request.body == '' }} - continue-on-error: true - id: pr_description - run: | - echo "Pull request description cannot be empty." - exit 1 - - name: Run Compliance Tests continue-on-error: true id: compliance diff --git a/.github/workflows/do_not_merge.yml b/.github/workflows/do_not_merge.yml index 39275a03f11..2c450efc7d6 100644 --- a/.github/workflows/do_not_merge.yml +++ b/.github/workflows/do_not_merge.yml @@ -1,8 +1,14 @@ -name: Do Not Merge +name: PR Metadata Check on: pull_request: - types: [synchronize, opened, reopened, labeled, unlabeled] + types: + - synchronize + - opened + - reopened + - labeled + - unlabeled + - edited permissions: contents: read @@ -22,3 +28,13 @@ jobs: echo "Pull request is labeled as 'DNM', 'TSC', 'Architecture Review' or 'dev-review'." echo "This workflow fails so that the pull request cannot be merged." exit 1 + + empty_pr_description: + if: ${{ github.event.pull_request.body == '' }} + name: PR Description + runs-on: ubuntu-22.04 + steps: + - name: Check for PR description + run: | + echo "Pull request description cannot be empty." + exit 1