-
Notifications
You must be signed in to change notification settings - Fork 0
22 lines (19 loc) · 889 Bytes
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
name: Validate Pull Request
on:
pull_request: # Trigger on pull request events
jobs:
validate:
runs-on: ubuntu-latest # Run the workflow on Ubuntu virtual machine
steps:
- uses: actions/checkout@v3 # Checkout the repository code
- name: Check PR Description
run: |
description=${{ github.event.pull_request.body }}
jira_regex="https?://[a-zA-Z0-9-.]+\.atlassian\.net/browse/[A-Z]+-\d+" # Regular expression for JIRA ticket link
if [[ -z "$description" ]]; then
echo "❌ Pull Request description is missing. Please provide a description of your changes."
exit 1
elif [[ ! $description =~ $jira_regex ]]; then
echo "❌ Pull Request description must contain a link to the JIRA ticket (e.g., https://yourcompany.atlassian.net/browse/JIRA-123)"
exit 1
fi