aarhus-2024 Reschedule devopsdays Aarhus, Denmark to 2025 #6
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
name: Pull Request Description Validation | |
on: | |
pull_request_target: | |
types: [opened, edited, reopened, synchronize] | |
jobs: | |
validate-pr-description: | |
runs-on: ubuntu-latest | |
permissions: | |
issues: write | |
pull-requests: write | |
steps: | |
- name: Check PR Description Against Template | |
id: prcheck | |
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="Bluth" | |
# Check for the required keyword in the PR description | |
if [[ $PR_DESCRIPTION = *"$KEYWORD"* ]]; then | |
echo "PR description does not have default text removed" | |
exit 1 | |
fi | |
- name: Comment on PR | |
id: comment | |
if: failure() && steps.prcheck.outcome == 'failure' | |
uses: thollander/actions-comment-pull-request@v2 | |
with: | |
message: | | |
Hi @${{ github.event.pull_request.user.login }}! It looks like you've left the default text in the pull request description. Please replace that text with something meaningful. Thanks! | |