-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GH action to check PR metadata (#303)
- Loading branch information
1 parent
6572f50
commit 3364c10
Showing
1 changed file
with
26 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,26 @@ | ||
name: Check PR Metadata | ||
|
||
on: | ||
pull_request: | ||
types: [ready_for_review, opened] | ||
|
||
jobs: | ||
check-pr-metadata: | ||
permissions: | ||
pull-requests: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: | | ||
if ! [[ -z "${BODY// }" ]] || [ "$DRAFT" = true ]; then | ||
echo "PR is draft or description has length, skipping comment." | ||
else | ||
gh pr comment "$NUMBER" --body "$MESSAGE" | ||
fi | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GH_REPO: ${{ github.repository }} | ||
NUMBER: ${{ github.event.pull_request.number }} | ||
DRAFT: ${{ github.event.pull_request.draft }} | ||
BODY: ${{ github.event.pull_request.body }} | ||
MESSAGE: > | ||
It looks like you didn't add a description to your pull request. Please edit and add as much detail as possible for the reviewers. Pull requests require a description before they will be reviewed - thank you. |