Skip to content

Commit 75ad9dc

Browse files
[Bug]: revert #158 and fix label-sync issue parsing (#157) (#159)
* Revert "[Bug]: prevent label-sync failures when no issue is linked (#157) (#158)" This reverts commit 7a5664a. * [label-sync] Parse linked issues safely with jq (#157) * Update wiki submodule pointer for PR #159 --------- Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 7a5664a commit 75ad9dc

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

  • .github
    • actions/label-sync/copy-linked-issue-labels

.github/actions/label-sync/copy-linked-issue-labels/run.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ set -euo pipefail
44
title="$(jq -r '.pull_request.title // ""' "${GITHUB_EVENT_PATH}")"
55
body="$(jq -r '.pull_request.body // ""' "${GITHUB_EVENT_PATH}")"
66
pull_request_number="$(jq -r '.pull_request.number // ""' "${GITHUB_EVENT_PATH}")"
7-
issue_number=''
8-
9-
linked_issue_pattern='(closes|fixes|resolves|addresses)[[:space:]]+#([[:digit:]]+)'
10-
11-
if [[ "${title} ${body}" =~ ${linked_issue_pattern} ]]; then
12-
issue_number="${BASH_REMATCH[2]}"
13-
fi
7+
issue_number="$(jq -rn \
8+
--arg title "${title}" \
9+
--arg body "${body}" '
10+
[$title, $body]
11+
| join(" ")
12+
| try (capture("(?i)(closes|fixes|resolves|addresses)\\s+#(?<issue>[0-9]+)") | .issue) catch ""
13+
')"
1414

1515
if [ -z "${issue_number}" ]; then
1616
echo "No linked issue was found in the pull request title or body."

.github/wiki

Submodule wiki updated from 7211e3c to a11e78b

0 commit comments

Comments
 (0)