Skip to content

Commit 4611dfd

Browse files
authored
Merge pull request coleam00#959 from dynamous-community/fix/issue-958-pr-number-extraction
fix: extract PR number from URL path, not first digits in message
2 parents bae1970 + 12c5a2d commit 4611dfd

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

.archon/workflows/defaults/archon-validate-pr.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@ nodes:
2121
- id: fetch-pr
2222
bash: |
2323
# Extract PR number from arguments
24-
PR_NUMBER=$(echo "$ARGUMENTS" | grep -oE '[0-9]+' | head -1)
24+
PR_NUMBER=$(echo "$ARGUMENTS" | grep -oE '/pull/[0-9]+' | grep -oE '[0-9]+' | head -1)
25+
# Fallback: extract first number if no URL path found (e.g., "validate PR 42")
26+
if [ -z "$PR_NUMBER" ]; then
27+
PR_NUMBER=$(echo "$ARGUMENTS" | grep -oE '[0-9]+' | head -1)
28+
fi
2529
if [ -z "$PR_NUMBER" ]; then
2630
# Try getting PR from current branch
2731
PR_NUMBER=$(gh pr view --json number -q '.number' 2>/dev/null)

.claude/skills/archon/examples/dag-workflow.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ nodes:
2020
# ── BASH NODE: Shell script, no AI, stdout captured as output ──
2121
- id: fetch-issue
2222
bash: |
23-
issue_num=$(echo "$ARGUMENTS" | grep -oE '[0-9]+' | head -1)
23+
issue_num=$(echo "$ARGUMENTS" | grep -oE '/issues/[0-9]+' | grep -oE '[0-9]+' | head -1)
24+
# Fallback: extract first number if no URL path found (e.g., "Fix issue #42")
25+
if [ -z "$issue_num" ]; then
26+
issue_num=$(echo "$ARGUMENTS" | grep -oE '[0-9]+' | head -1)
27+
fi
2428
if [ -n "$issue_num" ]; then
2529
gh issue view "$issue_num" --json title,body,labels,comments
2630
else

0 commit comments

Comments
 (0)