ci: compliance: add a PR description check step
Add an extra workflow step to block PRs with an empty description so that these gets flagged automatically and reviewers don't have to ask for it. Add a message in the actual fail step as well so it's easier for the user to figure out what went wrong, even in the existing compliance check case. Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
This commit is contained in:
parent
74c871dce2
commit
c05500fc6c
1 changed files with 22 additions and 1 deletions
23
.github/workflows/compliance.yml
vendored
23
.github/workflows/compliance.yml
vendored
|
@ -1,6 +1,12 @@
|
||||||
name: Compliance Checks
|
name: Compliance Checks
|
||||||
|
|
||||||
on: pull_request
|
on:
|
||||||
|
pull_request:
|
||||||
|
types:
|
||||||
|
- edited
|
||||||
|
- opened
|
||||||
|
- reopened
|
||||||
|
- synchronize
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check_compliance:
|
check_compliance:
|
||||||
|
@ -52,6 +58,14 @@ jobs:
|
||||||
west config manifest.group-filter -- +ci,-optional
|
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
|
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
|
- name: Run Compliance Tests
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
id: compliance
|
id: compliance
|
||||||
|
@ -94,5 +108,12 @@ jobs:
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ "${exit}" == "1" ]; then
|
if [ "${exit}" == "1" ]; then
|
||||||
|
echo "Compliance error, check for error messages in the \"Run Compliance Tests\" step"
|
||||||
|
echo "You can run this step locally with the ./scripts/ci/check_compliance.py script."
|
||||||
|
exit 1;
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "${{ steps.pr_description.outcome }}" == "failure" ]; then
|
||||||
|
echo "PR description cannot be empty"
|
||||||
exit 1;
|
exit 1;
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue