Skip to content

Commit

Permalink
Merge pull request Amna-Hassan04#47 from priyanshaggarwal001/pr_templ…
Browse files Browse the repository at this point in the history
…ate.md

Pr template.md
  • Loading branch information
Amna-Hassan04 authored Oct 3, 2024
2 parents d0c7e19 + 7e18419 commit d4d0557
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/pr_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
## Description

Please include a summary of the change and which issue is fixed. Also include relevant motivation and context.

- Fixes #(issue number)

## Type of change

Please delete options that are not relevant.

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Documentation update
- [ ] Tests update

## Checklist

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] My changes generate no new warnings
- [ ] New and existing unit tests pass locally with my changes
- [ ] I have maintained a clean commit history by using the necessary Git commands
- [ ] I have checked that my code does not cause any merge conflicts

## Screenshots (if applicable)

Add screenshots to help explain the changes (if necessary).
27 changes: 27 additions & 0 deletions .github/workflows/check_screenshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Check Screenshot in PR

on:
pull_request:
types: [opened, edited, synchronize]

jobs:
check-screenshot:
runs-on: ubuntu-latest

steps:
- name: Check if screenshot is attached
id: check_screenshot
run: |
# Fetch the PR body (description) using jq
PR_BODY=$(jq -r '.pull_request.body' "$GITHUB_EVENT_PATH")
# Log the PR body for debugging (you can remove this later)
echo "PR BODY: $PR_BODY"
# Check if the PR body contains a GitHub-hosted image URL or image extensions (png, jpg, jpeg, gif)
if echo "$PR_BODY" | grep -E "https://github.com/.+/assets/|\.png|\.jpg|\.jpeg|\.gif"; then
echo "Screenshot found!"
else
echo "No screenshot found! Please attach a screenshot to your PR."
exit 1 # Fail the workflow if no screenshot is found
fi

0 comments on commit d4d0557

Please sign in to comment.