Skip to content

Commit 1e0529a

Browse files
committed
build: omit issue references to other repositories
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent 758e76f commit 1e0529a

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

.github/workflows/scripts/generate_pr_commit_message

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,25 @@ main() {
220220
# Extract 'Signed-off-by' lines from commits:
221221
signed_off_bys=$(echo "$pr_commits" | jq -r '.[].commit.message' | grep -Eio 'Signed-off-by:.*' | sort -u)
222222

223-
# Extract linked issues from PR body (e.g., #123):
224-
issue_numbers=$(echo "$pr_body" | grep -oE '#[0-9]+' | grep -oE '[0-9]+' | sort | uniq)
223+
# Extract linked issues from PR body:
224+
issue_numbers=$(
225+
echo "$pr_body" |
226+
# Handle GitHub-supported issue references to stdlib-js/stdlib:
227+
#
228+
# - https://github.com/stdlib-js/stdlib/issues/123
229+
# - stdlib-js/stdlib#123
230+
# - #123 (**not** preceded by a word‑char, “/”, or “>”)
231+
grep -oE 'https://github\.com/stdlib-js/stdlib/issues/[0-9]+|stdlib-js/stdlib#[0-9]+|(^|[^[:alnum:]_/>])#[0-9]+' |
232+
# Strip the prefix so we’re left with the bare issue number:
233+
sed -E '
234+
s@https://github\.com/stdlib-js/stdlib/issues/([0-9]+)@\1@;
235+
s@stdlib-js/stdlib#([0-9]+)@\1@;
236+
s@(^|[^[:alnum:]_/>])#([0-9]+)@\2@
237+
' |
238+
# Remove duplicates:
239+
sort -u |
240+
uniq
241+
)
225242
closes_issues=""
226243
ref_issues=""
227244

0 commit comments

Comments
 (0)