Skip to content

Commit

Permalink
Add GH action to check PR metadata (#303)
Browse files Browse the repository at this point in the history
  • Loading branch information
calvincestari authored and gh-action-runner committed Mar 20, 2024
1 parent 6572f50 commit 3364c10
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/check-pr-metadata.yml
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.

0 comments on commit 3364c10

Please sign in to comment.