Skip to content

Commit 1a69ecc

Browse files
Merge pull request #30 from Harsh-Microsoft/grp-depbot-security-pr
refactor: Optimize dependency installation commands to run once for a…
2 parents 9ab929f + c3806df commit 1a69ecc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

.github/workflows/group-dependabot-security-updates.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -216,13 +216,13 @@ jobs:
216216
if [ -s deps_to_install.txt ]; then
217217
if [ -f "$project_dir/yarn.lock" ]; then
218218
echo "Using yarn to add/update dependencies in $project_dir..."
219-
# Use $GITHUB_WORKSPACE for an absolute path to the deps file.
220-
(cd "$project_dir" && xargs -n 1 yarn add < "$GITHUB_WORKSPACE/deps_to_install.txt")
219+
# Remove -n 1 to run yarn add only once with all dependencies.
220+
(cd "$project_dir" && xargs yarn add < "$GITHUB_WORKSPACE/deps_to_install.txt")
221221
git add "$project_dir/yarn.lock"
222222
else
223223
echo "Using npm to install/update dependencies in $project_dir..."
224-
# Use $GITHUB_WORKSPACE for an absolute path to the deps file.
225-
(cd "$project_dir" && xargs -n 1 npm install < "$GITHUB_WORKSPACE/deps_to_install.txt")
224+
# Remove -n 1 to run npm install only once with all dependencies.
225+
(cd "$project_dir" && xargs npm install < "$GITHUB_WORKSPACE/deps_to_install.txt")
226226
git add "$project_dir/package-lock.json"
227227
fi
228228
# Stage the manifest file that npm/yarn updated.

0 commit comments

Comments
 (0)