Skip to content

Commit 66720be

Browse files
[ACS-10100][Security] Remove npx usage from CI/CD and shell scripts to mitigate supply chain risks (#4795)
1 parent ccc08db commit 66720be

File tree

28 files changed

+184
-42
lines changed

28 files changed

+184
-42
lines changed

.github/actions/before-e2e/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ runs:
66
steps:
77
- name: Check content UP
88
shell: bash
9-
run: ./node_modules/@alfresco/adf-cli/bin/adf-cli check-cs-env --host $BASE_URL -u $ADMIN_EMAIL -p $ADMIN_PASSWORD || exit 1
9+
run: npm run ci:check-env || exit 1

.github/actions/publish-libs/action.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ runs:
2929

3030
- name: Build Libraries
3131
shell: bash
32-
run: npm ci && npx nx run-many --target=build
32+
run: |
33+
npm ci
34+
npm run ci:build:many
3335
3436
- uses: actions/setup-node@v4
3537
name: setup GH registry

.github/actions/run-e2e-playwright/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ runs:
3030
printf "\nApplication is ready.\n"
3131
3232
echo "Running playwright tests with options ${{ inputs.options }}"
33-
npx nx run ${{ inputs.options }}-e2e:e2e
33+
E2E_TARGET=${{ inputs.options }} npm run ci:e2e

.github/workflows/pull-request.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
run: npm run affected:lint -- --base=origin/develop
5656
- name: lint all
5757
if: ${{ github.event_name != 'pull_request' }}
58-
run: npx nx run-many --target=lint
58+
run: npm run ci:lint
5959
- run: npm run stylelint
6060

6161
build:
@@ -80,7 +80,7 @@ jobs:
8080
with:
8181
name: npm-logs
8282
path: /home/runner/.npm/_logs/
83-
- run: npx nx build aca-playwright-shared
83+
- run: npm run ci:build -- aca-playwright-shared
8484
- run: npm run build -- $BUILD_OPTS
8585

8686
- name: dist cache
@@ -119,7 +119,7 @@ jobs:
119119

120120
- name: Test all
121121
if: ${{ github.event_name != 'pull_request' }}
122-
run: npx nx run-many --target=test --browsers=ChromeHeadless --watch=false $TEST_OPTS
122+
run: npm run ci:test -- $TEST_OPTS
123123

124124
e2es-playwright:
125125
needs: [lint, build, unit-tests]
@@ -203,8 +203,7 @@ jobs:
203203
uses: ./.github/actions/before-e2e
204204

205205
- name: Before playwright
206-
shell: bash
207-
run: npx playwright install chromium
206+
run: npm run ci:playwright:install
208207

209208
- uses: ./.github/actions/run-e2e-playwright
210209
with:

.github/workflows/run-e2e-with-env.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
cache: 'npm'
4646
- uses: ./.github/actions/before-install
4747
- run: npm ci
48-
- run: npx nx build aca-playwright-shared
48+
- run: npm run ci:build -- aca-playwright-shared
4949
- run: npm run build -- $BUILD_OPTS
5050

5151
- name: dist cache
@@ -128,12 +128,12 @@ jobs:
128128
uses: ./.github/actions/before-e2e
129129

130130
- name: Before playwright
131-
shell: bash
132-
run: npx playwright install chromium
131+
run: npm run ci:playwright:install
133132

134133
- uses: ./.github/actions/run-e2e-playwright
135134
with:
136135
options: "${{ matrix.e2e-suites.name }}"
137136
artifact-name: ${{ matrix.e2e-suites.name }}
138137
test-runner: playwright
138+
139139
- uses: ./.github/actions/after-e2e

.husky/pre-commit

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
#!/usr/bin/env sh
2-
. "$(dirname -- "$0")/_/husky.sh"
3-
4-
npx lint-staged
1+
lint-staged

e2e/playwright/authentication/project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"e2e": {
88
"executor": "nx:run-commands",
99
"options": {
10-
"commands": ["npx playwright test --config=e2e/playwright/authentication/playwright.config.ts"]
10+
"commands": ["playwright test --config=e2e/playwright/authentication/playwright.config.ts"]
1111
},
1212
"configurations": {
1313
"production": {

e2e/playwright/copy-move-actions/project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"e2e": {
88
"executor": "nx:run-commands",
99
"options": {
10-
"commands": ["npx playwright test --config=e2e/playwright/copy-move-actions/playwright.config.ts"]
10+
"commands": ["playwright test --config=e2e/playwright/copy-move-actions/playwright.config.ts"]
1111
},
1212
"configurations": {
1313
"production": {

e2e/playwright/create-actions/project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"e2e": {
88
"executor": "nx:run-commands",
99
"options": {
10-
"commands": ["npx playwright test --config=e2e/playwright/create-actions/playwright.config.ts"]
10+
"commands": ["playwright test --config=e2e/playwright/create-actions/playwright.config.ts"]
1111
},
1212
"configurations": {
1313
"production": {

e2e/playwright/delete-actions/project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"e2e": {
88
"executor": "nx:run-commands",
99
"options": {
10-
"commands": ["npx playwright test --config=e2e/playwright/delete-actions/playwright.config.ts"]
10+
"commands": ["playwright test --config=e2e/playwright/delete-actions/playwright.config.ts"]
1111
},
1212
"configurations": {
1313
"production": {

0 commit comments

Comments
 (0)