-
Notifications
You must be signed in to change notification settings - Fork 90
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
1 parent
7da575e
commit 8018538
Showing
1 changed file
with
24 additions
and
0 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,24 @@ | ||
name: Check for Screenshot | ||
|
||
on: | ||
pull_request: | ||
types: [opened, edited, synchronize] | ||
|
||
jobs: | ||
check-screenshot: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check for screenshot in pull request | ||
id: check_screenshot | ||
run: | | ||
# Fetch the PR description and extract the body | ||
PR_BODY=$(jq -r '.pull_request.body' "$GITHUB_EVENT_PATH") | ||
# Check if the PR body contains an image link or attachment (formats: .png, .jpg, .jpeg, .gif) | ||
if echo "$PR_BODY" | grep -E "\.(png|jpg|jpeg|gif)"; then | ||
echo "Screenshot found!" | ||
else | ||
echo "No screenshot found! Please attach a screenshot to your PR." | ||
exit 1 | ||
fi |