Actions: attempt to validate PR description tests #4
Workflow file for this run
This file contains hidden or 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: PR Description Validator | |
| on: | |
| pull_request: | |
| types: [opened, edited, reopened] | |
| jobs: | |
| validate-pr-description: | |
| name: Validate PR Description | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Set up workspace | |
| uses: actions/checkout@v2 | |
| - name: Validate PR Description | |
| run: | | |
| # Ensure jq is installed | |
| sudo apt-get install jq | |
| # Fetch PR description using jq | |
| PR_DESCRIPTION=$(jq -r ".pull_request.body" "$GITHUB_EVENT_PATH") | |
| KEYWORD="REQUIRED_KEYWORD" | |
| # Check for the required keyword in the PR description | |
| if [[ $PR_DESCRIPTION = *"<!--"* ]] || [[ $PR_DESCRIPTION = *"-->"* ]]; then | |
| echo "Please remove the welcome comment from your PR description." | |
| exit 1 | |
| fi |