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>
This commit is contained in:
parent
5b743871b8
commit
db18e4c507
10
.github/workflows/pr_metadata_check.yml
vendored
10
.github/workflows/pr_metadata_check.yml
vendored
@ -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
|
||||
|
||||
@ -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__":
|
||||
|
||||
Loading…
Reference in New Issue
Block a user