-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
162 changed files
with
1,809 additions
and
698 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
*Issue #, if available:* | ||
|
||
*What was changed?* | ||
|
||
*Why was it changed?* | ||
|
||
*How was it changed?* | ||
|
||
*What testing was done for the changes?* | ||
|
||
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice. |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: PR Description Check | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- develop | ||
- master | ||
types: | ||
- opened | ||
- synchronize | ||
- reopened | ||
- edited | ||
|
||
jobs: | ||
check-description: | ||
runs-on: macos-latest | ||
steps: | ||
- name: Install GitHub CLI | ||
run: | | ||
brew install gh | ||
- name: Check PR Description | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
pr_description=$(gh pr view https://github.com/${GITHUB_REPOSITORY}/pull/${{ github.event.pull_request.number }} --json body -q ".body") | ||
error_occurred=0 | ||
# Define minimum character count for each section | ||
MIN_CHARS=25 | ||
# Extract contents | ||
what_changed=$(echo "$pr_description" | sed -n -e '/\*What was changed?\*/,/\*/p' | sed '$d' | sed '1d') | ||
why_changed=$(echo "$pr_description" | sed -n -e '/\*Why was it changed?\*/,/\*/p' | sed '$d' | sed '1d') | ||
how_changed=$(echo "$pr_description" | sed -n -e '/\*How was it changed?\*/,/\*/p' | sed '$d' | sed '1d') | ||
testing_done=$(echo "$pr_description" | sed -n -e '/\*What testing was done for the changes?\*/,/\*/p' | sed '$d' | sed '1d') | ||
if [[ ${#what_changed} -lt $MIN_CHARS ]]; then | ||
echo "PR description for what changed section is either missing or too short." | ||
error_occurred=1 | ||
fi | ||
if [[ ${#why_changed} -lt $MIN_CHARS ]]; then | ||
echo "PR description for why it changed section is either missing or too short." | ||
error_occurred=1 | ||
fi | ||
if [[ ${#how_changed} -lt $MIN_CHARS ]]; then | ||
echo "PR description for how was it changed section is either missing or too short." | ||
error_occurred=1 | ||
fi | ||
if [[ ${#testing_done} -lt $MIN_CHARS ]]; then | ||
echo "PR description for testing section are either missing or too short." | ||
error_occurred=1 | ||
fi | ||
if [[ $error_occurred -eq 1 ]]; then | ||
exit 1 | ||
fi |
Oops, something went wrong.