Skip to content

Commit 01c546b

Browse files
committed
build: strip stdlib prefix from commit message and PR
--- 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 23cbd7c commit 01c546b

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

.github/workflows/namespace_declarations.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,11 @@ jobs:
110110
# Process each namespace:
111111
while IFS= read -r namespace; do
112112
if [ -n "$namespace" ] && [[ $namespace != *"_tools"* ]]; then
113-
branch_name="update-$(echo "$namespace" | sed 's/@stdlib\///' | sed 's/\//-/g')-declarations"
113+
# Namespace without the '@stdlib/' scope for display in commit messages and PR titles:
114+
display_namespace="${namespace#@stdlib/}"
115+
116+
# Branch name slug with slashes replaced by dashes:
117+
branch_name="update-${display_namespace//\//-}-declarations"
114118
git checkout -b "$branch_name"
115119
116120
# Generate declarations for this namespace:
@@ -122,13 +126,13 @@ jobs:
122126
git add lib/node_modules/@stdlib
123127
124128
# Commit changes:
125-
git commit -m "feat: update \`${namespace}\` TypeScript declarations" --signoff
129+
git commit -m "feat: update \`${display_namespace}\` TypeScript declarations" --signoff
126130
127131
# Push branch and create PR:
128132
git push origin "$branch_name"
129133
130134
gh pr create \
131-
--title "feat: update \`${namespace}\` TypeScript declarations" \
135+
--title "feat: update \`${display_namespace}\` TypeScript declarations" \
132136
--body "This PR updates TypeScript declarations for the \`${namespace}\` namespace.
133137
134138
## Reviewer Checklist

0 commit comments

Comments
 (0)