Skip to content

Commit db18e4c

Browse files
fabiobaltieridanieldegrasse
authored andcommitted
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 <fabiobaltieri@google.com>
1 parent 5b74387 commit db18e4c

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

.github/workflows/pr_metadata_check.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,3 @@ jobs:
3737
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3838
run: |
3939
./scripts/ci/do_not_merge.py -p "${{ github.event.pull_request.number }}"
40-
41-
empty_pr_description:
42-
if: ${{ github.event.pull_request.body == '' }}
43-
name: PR Description
44-
runs-on: ubuntu-24.04
45-
steps:
46-
- name: Check for PR description
47-
run: |
48-
echo "Pull request description cannot be empty."
49-
exit 1

scripts/ci/do_not_merge.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,22 @@ def main(argv):
4444

4545
print(f"pr: {pr.html_url}")
4646

47+
fail = False
48+
4749
for label in pr.get_labels():
4850
print(f"label: {label.name}")
4951

5052
if label.name in DNM_LABELS:
5153
print(f"Pull request is labeled as \"{label.name}\".")
52-
print("This workflow fails so that the pull request cannot be merged.")
53-
sys.exit(1)
54+
fail = True
55+
56+
if not pr.body:
57+
print("Pull request is description is empty.")
58+
fail = True
59+
60+
if fail:
61+
print("This workflow fails so that the pull request cannot be merged.")
62+
sys.exit(1)
5463

5564

5665
if __name__ == "__main__":

0 commit comments

Comments
 (0)