Skip to content

Commit 7bb738b

Browse files
committed
refactor
1 parent d2e8ea5 commit 7bb738b

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

.github/workflows/test.yml

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,17 @@ jobs:
2323
run: |
2424
PREVIOUS_TAG=$(git describe --tags --abbrev=0)
2525
TAG_DATE=$(git log -1 --format="%ci" "$PREVIOUS_TAG" | sed 's/ /T/' | sed 's/ +0000/Z/')
26-
echo "$TAG_DATE"
26+
echo "Using tag date: $TAG_DATE"
2727
28-
PR_DATA=$(gh pr list \
29-
--search "is:pr is:open created:>=$TAG_DATE" \
30-
--json number,body \
31-
--jq '.[] | select(.body != null and (.body | test("issues/\\d+"))) | [.body | scan("issues/(\\d+)"; "g")] | .[]'
32-
)
33-
echo "Found PRs:"
34-
echo "$PR_DATA"
35-
gh pr list \
36-
--search "is:pr is:open created:>=$TAG_DATE" \
37-
--json number,body \
38-
--jq '.[] | select(.body != null and (.body | test("issues/\\d+"))) | [.body | scan("issues/(\\d+)"; "g")] | .[]'
39-
| while read issue_number; do
28+
ISSUE_NUMBERS=$(gh pr list --search "is:pr is:open created:>=$TAG_DATE" --json number,body --jq '.[] | select(.body != null and (.body | test("issues/\\d+"))) | [.body | scan("issues/(\\d+)"; "g")] | .[]' | sort -u)
29+
30+
if [ -z "$ISSUE_NUMBERS" ]; then
31+
echo "No issues found in recent PRs"
32+
exit 0
33+
fi
34+
35+
echo "Found issues: $ISSUE_NUMBERS"
36+
for issue_number in $ISSUE_NUMBERS; do
4037
echo "Commenting on issue #$issue_number"
4138
gh issue comment "$issue_number" --body "This issue was resolved and included in the latest release."
4239
done

0 commit comments

Comments
 (0)