diff --git a/.github/actions/install-deps-github-script/action.yaml b/.github/actions/install-deps-github-script/action.yaml new file mode 100644 index 000000000000..74d7b0a92c55 --- /dev/null +++ b/.github/actions/install-deps-github-script/action.yaml @@ -0,0 +1,15 @@ +name: Install dependencies for github-script actions +description: Installs dependencies for github-script actions + +runs: + using: composite + + steps: + - uses: ./.github/actions/setup-node-install-deps + with: + # actions/github-script@v8 uses Node 24 + node-version: 24.x + # "--no-audit": improves performance + # "--omit dev": not needed at runtime, improves performance + install-command: "npm ci --no-audit --omit dev" + working-directory: ./.github diff --git a/.github/workflows/arm-auto-signoff-code.yaml b/.github/workflows/arm-auto-signoff-code.yaml index f75bf2fbf2de..632d9a2a6061 100644 --- a/.github/workflows/arm-auto-signoff-code.yaml +++ b/.github/workflows/arm-auto-signoff-code.yaml @@ -35,15 +35,8 @@ jobs: sparse-checkout: | .github - - name: Setup Node 24 and install deps - uses: ./.github/actions/setup-node-install-deps - with: - # actions/github-script@v8 uses Node 24 - node-version: 24.x - # "--no-audit": improves performance - # "--omit dev": not needed at runtime, improves performance - install-command: "npm ci --no-audit --omit dev" - working-directory: ./.github + - name: Install dependencies for github-script actions + uses: ./.github/actions/install-deps-github-script # Output is "true" if PR contains only incremental changes to an existing TypeSpec RP - id: incremental-typespec diff --git a/.github/workflows/avocado-code.yaml b/.github/workflows/avocado-code.yaml index ed5d0e920cb7..ed281801da25 100644 --- a/.github/workflows/avocado-code.yaml +++ b/.github/workflows/avocado-code.yaml @@ -66,19 +66,12 @@ jobs: TRAVIS_REPO_SLUG: ${{ github.repository }} TRAVIS_PULL_REQUEST_SHA: ${{ github.sha }} - - name: Setup Node 24 and install deps (under .github) - if: ${{ always() && (steps.run-avocado.outputs.output-file) }} - uses: ./.github/actions/setup-node-install-deps - with: - # actions/github-script@v8 uses Node 24 - node-version: 24.x - # "--no-audit": improves performance - # "--omit dev": not needed at runtime, improves performance - install-command: "npm ci --no-audit --omit dev" - working-directory: ./.github + - if: ${{ always() && (steps.run-avocado.outputs.output-file) }} + name: Install dependencies for github-script actions + uses: ./.github/actions/install-deps-github-script - - name: Generate job summary - if: ${{ always() && (steps.run-avocado.outputs.output-file) }} + - if: ${{ always() && (steps.run-avocado.outputs.output-file) }} + name: Generate job summary id: generate-job-summary uses: actions/github-script@v8 with: @@ -90,8 +83,8 @@ jobs: AVOCADO_OUTPUT_FILE: ${{ steps.run-avocado.outputs.output-file }} # Used by other workflows like set-status - - name: Set job-summary artifact - if: ${{ always() && steps.generate-job-summary.outputs.summary }} + - if: ${{ always() && steps.generate-job-summary.outputs.summary }} + name: Set job-summary artifact uses: actions/upload-artifact@v6 with: name: job-summary diff --git a/.github/workflows/github-test.yaml b/.github/workflows/github-test.yaml index 363cb48aeee4..60d07bdce08b 100644 --- a/.github/workflows/github-test.yaml +++ b/.github/workflows/github-test.yaml @@ -46,15 +46,8 @@ jobs: args: -color -verbose - if: ${{ matrix.folder == '.github' }} - name: Setup Node 24 and install runtime deps - uses: ./.github/actions/setup-node-install-deps - with: - # actions/github-script@v8 uses Node 24 - node-version: 24.x - # "--no-audit": improves performance - # "--omit dev": not needed at runtime, improves performance - install-command: "npm ci --no-audit --omit dev" - working-directory: ./${{ matrix.folder }} + name: Install dependencies for github-script actions + uses: ./.github/actions/install-deps-github-script - if: ${{ matrix.folder == '.github' }} name: Verify all modules are importable diff --git a/.github/workflows/sdk-breaking-change-labels.yaml b/.github/workflows/sdk-breaking-change-labels.yaml index f9dd5c061fc3..15661cd55131 100644 --- a/.github/workflows/sdk-breaking-change-labels.yaml +++ b/.github/workflows/sdk-breaking-change-labels.yaml @@ -39,15 +39,8 @@ jobs: ADO_TOKEN=$(az account get-access-token --resource "499b84ac-1321-427f-aa17-267ca6975798" --query "accessToken" -o tsv) echo "ADO_TOKEN=$ADO_TOKEN" >> "$GITHUB_ENV" - - name: Setup Node 24 and install deps - uses: ./.github/actions/setup-node-install-deps - with: - # actions/github-script@v8 uses Node 24 - node-version: 24.x - # "--no-audit": improves performance - # "--omit dev": not needed at runtime, improves performance - install-command: "npm ci --no-audit --omit dev" - working-directory: ./.github + - name: Install dependencies for github-script actions + uses: ./.github/actions/install-deps-github-script - name: Get label and action id: get-label-and-action diff --git a/.github/workflows/spec-gen-sdk-status.yml b/.github/workflows/spec-gen-sdk-status.yml index 8283755efb04..cfc4ba446c08 100644 --- a/.github/workflows/spec-gen-sdk-status.yml +++ b/.github/workflows/spec-gen-sdk-status.yml @@ -39,15 +39,8 @@ jobs: ADO_TOKEN=$(az account get-access-token --resource "499b84ac-1321-427f-aa17-267ca6975798" --query "accessToken" -o tsv) echo "ADO_TOKEN=$ADO_TOKEN" >> "$GITHUB_ENV" - - name: Setup Node 24 and install deps - uses: ./.github/actions/setup-node-install-deps - with: - # actions/github-script@v8 uses Node 24 - node-version: 24.x - # "--no-audit": improves performance - # "--omit dev": not needed at runtime, improves performance - install-command: "npm ci --no-audit --omit dev" - working-directory: ./.github + - name: Install dependencies for github-script actions + uses: ./.github/actions/install-deps-github-script - name: "SDK Validation Set Status" id: sdk-validation-status diff --git a/.github/workflows/summarize-checks.yaml b/.github/workflows/summarize-checks.yaml index eb71df0dc597..ce2ac57c13a3 100644 --- a/.github/workflows/summarize-checks.yaml +++ b/.github/workflows/summarize-checks.yaml @@ -53,15 +53,8 @@ jobs: sparse-checkout: | .github - - name: Setup Node 24 and install deps - uses: ./.github/actions/setup-node-install-deps - with: - # actions/github-script@v8 uses Node 24 - node-version: 24.x - # "--no-audit": improves performance - # "--omit dev": not needed at runtime, improves performance - install-command: "npm ci --no-audit --omit dev" - working-directory: ./.github + - name: Install dependencies for github-script actions + uses: ./.github/actions/install-deps-github-script - id: dump-trigger-metadata name: Dump Trigger Metadata