diff --git a/.github/workflows/pr-description.yaml b/.github/workflows/pr-description.yaml new file mode 100644 index 0000000000..283638d811 --- /dev/null +++ b/.github/workflows/pr-description.yaml @@ -0,0 +1,30 @@ +name: PR Description + +on: + pull_request: + types: [opened, edited, reopened, synchronize] + merge_group: + branches: [main] + +jobs: + validate-pr-description: + runs-on: ubuntu-latest + steps: + - name: Set up workspace + uses: actions/checkout@v2 + + - name: Validate description + run: | + # Fetch PR description from env with jq + PR_DESCRIPTION=$(jq -r ".pull_request.body" "$GITHUB_EVENT_PATH") + KEYWORD="REQUIRED_KEYWORD" + + # Ensure PR author removed the welcome comment + if [[ $PR_DESCRIPTION = *""* ]]; then + echo "FAILED: Please remove the welcome comment from your PR description." + exit 1 + else + echo "OK: Welcome comment is removed your PR description." + fi + + echo "PASS: All checks OK!"