Skip to content

Commit

Permalink
Create check_screenshot.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
priyanshaggarwal001 authored Oct 3, 2024
1 parent 7da575e commit 8018538
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/check_screenshot.yml
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

0 comments on commit 8018538

Please sign in to comment.