You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Check if this commit exists in the release branch
54
-
if git merge-base --is-ancestor "$MERGE_COMMIT" origin/release 2>/dev/null; then
55
-
echo "PR $pr_number is in release branch"
56
-
57
-
# Get issue numbers from this PR
58
-
PR_ISSUES=$(gh pr view "$pr_number" --json body --jq '.body' | \
59
-
grep -o 'issues/[0-9]*' | \
60
-
sed 's/issues\///')
61
-
echo " Found issues: $PR_ISSUES"
62
-
63
-
ISSUE_NUMBERS="$ISSUE_NUMBERS $PR_ISSUES"
64
-
fi
65
-
done
66
-
67
-
# Comment on each issue found
68
-
echo "$ISSUE_NUMBERS" | tr ' ' '\n' | while read -r issue_number; do
69
-
if [ -n "$issue_number" ]; then
70
-
echo "Commenting on issue #$issue_number"
71
-
gh issue comment "$issue_number" --body "A change related to this issue was included in release: $CURRENT_TAG" || echo "::error Failed to comment on #$issue_number"
72
-
fi
73
-
done
23
+
run: |
24
+
# Get the previous tag
25
+
PREVIOUS_TAG=$(git tag --sort=-version:refname | sed -n '2p')
26
+
CURRENT_TAG=$(git tag --sort=-version:refname | sed -n '1p')
27
+
28
+
# Convert tag date to GitHub search format
29
+
TAG_DATE=$(git log -1 --format="%ci" "$PREVIOUS_TAG" | sed 's/ /T/' | sed 's/ +0000/Z/')
30
+
echo "Using tag date: $TAG_DATE"
31
+
32
+
# Find all PRs merged from the last release tag date
# Check if this commit exists in the release branch
47
+
if git merge-base --is-ancestor "$MERGE_COMMIT" origin/release 2>/dev/null; then
48
+
echo "PR $pr_number is in release branch"
49
+
50
+
# Get issue numbers from this PR
51
+
PR_ISSUES=$(gh pr view "$pr_number" --json body --jq '.body' | \
52
+
grep -o 'issues/[0-9]*' | \
53
+
sed 's/issues\///')
54
+
echo " Found issues: $PR_ISSUES"
55
+
56
+
ISSUE_NUMBERS="$ISSUE_NUMBERS $PR_ISSUES"
57
+
fi
58
+
done
59
+
60
+
# Comment on each issue found
61
+
echo "$ISSUE_NUMBERS" | tr ' ' '\n' | while read -r issue_number; do
62
+
if [ -n "$issue_number" ]; then
63
+
echo "Commenting on issue #$issue_number"
64
+
gh issue comment "$issue_number" --body "A change related to this issue was included in release: $CURRENT_TAG" || echo "::error Failed to comment on #$issue_number"
0 commit comments