Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Actions: attempt to validate PR description tests #2810

Merged
merged 6 commits into from
Feb 1, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/pr-description.yaml
Original file line number Diff line number Diff line change
@@ -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 = *"<!--"* ]] || [[ $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!"
Loading