Last active
April 9, 2021 22:53
-
-
Save vilmibm/d793797b20178d795460e40dc46c52d5 to your computer and use it in GitHub Desktop.
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
name: Pull Request Check | |
on: pull_request | |
# We'll keep this around for testing in the future | |
#on: | |
# workflow_dispatch: | |
# inputs: | |
# pull_request_body: | |
# default: "" | |
# pull_request_number: | |
# default: "123" | |
jobs: | |
check-body-length: | |
runs-on: ubuntu-latest | |
steps: | |
- name: check | |
env: | |
PRNUM: ${{ github.event.pull_request.number }} | |
PRBODY: ${{ github.event.pull_request.body }} | |
#PRNUM: ${{ github.event.inputs.pull_request_number }} | |
#PRBODY: ${{ github.event.inputs.pull_request_body }} | |
#TEST: "true" | |
run: | | |
commentPR () { | |
if [ "$TEST" = "true" ] | |
then | |
echo "gh pr comment $PRNUM -b '${1}'" | |
else | |
gh pr comment $PRNUM -b "${1}" | |
fi | |
} | |
if [ $(wc -c <<<"$PRBODY") -lt 10 ] | |
then | |
commentPR "Thanks! Please add more context to the PR body so we can better review your contribution." | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment