Skip to content

Commit 79afbf1

Browse files
Merge pull request #5725 from simpledotorg/master
2 parents 09f1757 + 51b6c9a commit 79afbf1

3 files changed

Lines changed: 33 additions & 9 deletions

File tree

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,30 @@
11
#!/bin/bash
2+
set -e
23

3-
link="$1"
4+
PR_BODY="$1"
45

5-
story_regex="https:\/\/app.shortcut.com\/simpledotorg\/story\/[0-9]+(\/.*)?"
6+
JIRA_KEY_REGEX='[A-Z][A-Z0-9]+-[0-9]+'
67

7-
if [[ "$link" =~ $story_regex ]]; then
8-
echo "PR description contains a valid story link."
8+
echo "🔍 Verifying Jira reference..."
9+
10+
# 1. Check PR body
11+
if [[ "$PR_BODY" =~ $JIRA_KEY_REGEX ]]; then
12+
echo "✅ Jira key found in PR description"
13+
exit 0
14+
fi
15+
16+
# 2. Check PR title
17+
if [[ "$GITHUB_PR_TITLE" =~ $JIRA_KEY_REGEX ]]; then
18+
echo "✅ Jira key found in PR title"
919
exit 0
10-
else
11-
echo "PR description doesn't contain any valid story links."
12-
exit 1
1320
fi
21+
22+
# 3. Check branch name
23+
if [[ "$GITHUB_HEAD_REF" =~ $JIRA_KEY_REGEX ]]; then
24+
echo "✅ Jira key found in branch name"
25+
exit 0
26+
fi
27+
28+
echo "❌ No Jira issue key found."
29+
echo "Expected something like ENG-1234 in branch name, PR title, PR description."
30+
exit 1

.github/workflows/ci_checks.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,15 @@ concurrency:
1414
cancel-in-progress: true
1515

1616
jobs:
17-
verify_pr_has_story_link:
17+
verify_pr_has_jira_reference:
1818
runs-on: [ ubuntu-latest ]
1919
if: github.event_name == 'pull_request'
2020
steps:
2121
- uses: actions/checkout@v6
22-
- name: Verify PR description
22+
- name: Verify PR has Jira reference
23+
env:
24+
GITHUB_PR_TITLE: ${{ github.event.pull_request.title }}
25+
GITHUB_HEAD_REF: ${{ github.head_ref }}
2326
run: .github/scripts/story_link_check.sh '${{ github.event.pull_request.body }}'
2427

2528
verify_changelog_was_updated:

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## Next Release
44

5+
### Internal
6+
7+
-Update `ci-checks.yml` & `story-link-check.sh` to verify valid jira reference
8+
59
## 2026.02.02
610

711
### Internal

0 commit comments

Comments
 (0)