From db18e4c5079da511b80e6d0f67dae78ad99fe272 Mon Sep 17 00:00:00 2001 From: Fabio Baltieri Date: Thu, 29 May 2025 13:36:13 +0000 Subject: [PATCH] scripts: do_not_merge: integrate the empty body check in the python file No point spreading the logic around, the python file already has the data, check it there. Signed-off-by: Fabio Baltieri --- .github/workflows/pr_metadata_check.yml | 10 ---------- scripts/ci/do_not_merge.py | 13 +++++++++++-- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/.github/workflows/pr_metadata_check.yml b/.github/workflows/pr_metadata_check.yml index 8f26af73a05..412903c2a03 100644 --- a/.github/workflows/pr_metadata_check.yml +++ b/.github/workflows/pr_metadata_check.yml @@ -37,13 +37,3 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | ./scripts/ci/do_not_merge.py -p "${{ github.event.pull_request.number }}" - - empty_pr_description: - if: ${{ github.event.pull_request.body == '' }} - name: PR Description - runs-on: ubuntu-24.04 - steps: - - name: Check for PR description - run: | - echo "Pull request description cannot be empty." - exit 1 diff --git a/scripts/ci/do_not_merge.py b/scripts/ci/do_not_merge.py index a22b4271ad6..a93b373a01a 100755 --- a/scripts/ci/do_not_merge.py +++ b/scripts/ci/do_not_merge.py @@ -44,13 +44,22 @@ def main(argv): print(f"pr: {pr.html_url}") + fail = False + for label in pr.get_labels(): print(f"label: {label.name}") if label.name in DNM_LABELS: print(f"Pull request is labeled as \"{label.name}\".") - print("This workflow fails so that the pull request cannot be merged.") - sys.exit(1) + fail = True + + if not pr.body: + print("Pull request is description is empty.") + fail = True + + if fail: + print("This workflow fails so that the pull request cannot be merged.") + sys.exit(1) if __name__ == "__main__":