Skip to content

Commit addec92

Browse files
committed
Use environment for output and escape pkg
1 parent 11a1bb6 commit addec92

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

.github/workflows/run_affected_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ jobs:
131131
if: github.event_name == 'workflow_dispatch'
132132
id: changed-files-user-input
133133
run: |
134-
echo "::set-output name=all_changed_files::${{ github.event.inputs.files }}"
134+
echo "all_changed_files=${{ github.event.inputs.files }}" >> $GITHUB_OUTPUT
135135
timeout-minutes: 5
136136

137137
# Run JavaScript tests:

.github/workflows/scripts/run_affected_tests

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,8 @@ main() {
121121
required_by=""
122122
for package in ${packages}; do
123123
echo "Finding packages which depend on '${package}'..."
124-
dependents=$(find lib/node_modules/@stdlib -type f -name '*.js' -print0 | xargs -0 grep -ol -E "require\( [']${package}['] \)")
124+
escaped_package=$(echo "$package" | sed 's/[\/&]/\\&/g')
125+
dependents=$(find lib/node_modules/@stdlib -type f -name '*.js' -print0 | xargs -0 grep -ol -E "require\( [']${escaped_package}['] \)")
125126
echo "Found: ${dependents}"
126127
if [ -n "${dependents}" ]; then
127128
dependents=$(dirname $dependents | sed -E 's/\/(bin|data|etc|include|lib|src|test)\/?$//' | sort -u)

0 commit comments

Comments
 (0)