-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
963238d
commit a998d83
Showing
1 changed file
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Check PR description | ||
|
||
on: | ||
# https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#pull_request | ||
pull_request: | ||
types: | ||
- edited | ||
- labeled | ||
- opened | ||
- reopened | ||
- synchronize | ||
- unlabeled | ||
branches: | ||
- master | ||
|
||
jobs: | ||
trigger-build: | ||
# https://docs.github.com/en/actions/writing-workflows/choosing-where-your-workflow-runs/choosing-the-runner-for-a-job | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check PR description | ||
env: | ||
PR_BODY: ${{ github.event.pull_request.body }} | ||
KTLO: ${{ contains(github.event.pull_request.labels.*.name, 'ktlo') }} | ||
run: | | ||
errors=0 | ||
if [[ "${PR_BODY}" == *"Do not merge"* ]] ; then | ||
echo "PR description contains 'Do not merge'" | ||
((errors += 1)) | ||
fi | ||
if [[ "${KTLO}" != "true" ]] && [[ "${PR_BODY}" != *"astronomer/issues"* ]] ; then | ||
echo "PR description does not contain an issue link" | ||
((errors += 1)) | ||
fi | ||
if [[ "${#PR_BODY}" -lt 20 ]] ; then | ||
echo "PR description is too short" | ||
((errors += 1)) | ||
fi | ||
exit "$errors" |