diff --git a/docs/nx-cloud/enterprise/dte/azure-dte.md b/docs/nx-cloud/enterprise/dte/azure-dte.md index 7e0d8c4e33..87bf0c92ed 100644 --- a/docs/nx-cloud/enterprise/dte/azure-dte.md +++ b/docs/nx-cloud/enterprise/dte/azure-dte.md @@ -33,6 +33,7 @@ jobs: steps: - checkout: self fetchDepth: 0 + fetchFilter: tree:0 persistCredentials: true - script: npm ci diff --git a/docs/nx-cloud/enterprise/dte/github-dte.md b/docs/nx-cloud/enterprise/dte/github-dte.md index 2445b02421..077dbd6200 100644 --- a/docs/nx-cloud/enterprise/dte/github-dte.md +++ b/docs/nx-cloud/enterprise/dte/github-dte.md @@ -40,6 +40,7 @@ jobs: ref: ${{ github.event.pull_request.head.sha }} # We need to fetch all branches and commits so that Nx affected has a base to compare against. fetch-depth: 0 + filter: tree:0 - uses: actions/checkout@v4 name: Checkout [Default Branch] @@ -47,6 +48,7 @@ jobs: with: # We need to fetch all branches and commits so that Nx affected has a base to compare against. fetch-depth: 0 + filter: tree:0 # Set node/npm/yarn versions using volta - uses: volta-cli/action@v4 diff --git a/docs/nx-cloud/features/split-e2e-tasks.md b/docs/nx-cloud/features/split-e2e-tasks.md index c34ed27870..6227c4f038 100644 --- a/docs/nx-cloud/features/split-e2e-tasks.md +++ b/docs/nx-cloud/features/split-e2e-tasks.md @@ -427,6 +427,7 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 + filter: tree:0 - uses: pnpm/action-setup@v4 with: diff --git a/docs/nx-cloud/tutorial/github-actions.md b/docs/nx-cloud/tutorial/github-actions.md index d35e4d76e8..bb593b3456 100644 --- a/docs/nx-cloud/tutorial/github-actions.md +++ b/docs/nx-cloud/tutorial/github-actions.md @@ -72,6 +72,7 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 + filter: tree:0 - uses: pnpm/action-setup@v4 with: @@ -207,6 +208,7 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 + filter: tree:0 - uses: pnpm/action-setup@v4 with: diff --git a/docs/shared/features/distribute-task-execution.md b/docs/shared/features/distribute-task-execution.md index ac020e1346..33ac7a31e3 100644 --- a/docs/shared/features/distribute-task-execution.md +++ b/docs/shared/features/distribute-task-execution.md @@ -54,6 +54,7 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 + filter: tree:0 - run: pnpm dlx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" diff --git a/docs/shared/migration/adding-to-existing-project.md b/docs/shared/migration/adding-to-existing-project.md index b049492194..f3e678673b 100644 --- a/docs/shared/migration/adding-to-existing-project.md +++ b/docs/shared/migration/adding-to-existing-project.md @@ -354,6 +354,8 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 + filter: tree:0 + # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun diff --git a/docs/shared/migration/adding-to-monorepo.md b/docs/shared/migration/adding-to-monorepo.md index 28640136d8..e594b8fba3 100644 --- a/docs/shared/migration/adding-to-monorepo.md +++ b/docs/shared/migration/adding-to-monorepo.md @@ -373,6 +373,8 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 + filter: tree:0 + # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun diff --git a/docs/shared/migration/migration-angular.md b/docs/shared/migration/migration-angular.md index 8a7c48b969..0045c926c3 100644 --- a/docs/shared/migration/migration-angular.md +++ b/docs/shared/migration/migration-angular.md @@ -176,6 +176,8 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 + filter: tree:0 + # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun diff --git a/docs/shared/monorepo-ci-azure.md b/docs/shared/monorepo-ci-azure.md index 95ad3a8a06..abbfb36adb 100644 --- a/docs/shared/monorepo-ci-azure.md +++ b/docs/shared/monorepo-ci-azure.md @@ -33,6 +33,7 @@ jobs: steps: - checkout: self fetchDepth: 0 + fetchFilter: tree:0 persistCredentials: true # Set Azure Devops CLI default settings diff --git a/docs/shared/monorepo-ci-github-actions.md b/docs/shared/monorepo-ci-github-actions.md index 9cd62da24c..5fdf48b2a8 100644 --- a/docs/shared/monorepo-ci-github-actions.md +++ b/docs/shared/monorepo-ci-github-actions.md @@ -28,6 +28,8 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 + filter: tree:0 + - uses: actions/setup-node@v3 with: node-version: 20 diff --git a/docs/shared/recipes/nx-release/publish-in-ci-cd.md b/docs/shared/recipes/nx-release/publish-in-ci-cd.md index abccb32299..5723b0c2c8 100644 --- a/docs/shared/recipes/nx-release/publish-in-ci-cd.md +++ b/docs/shared/recipes/nx-release/publish-in-ci-cd.md @@ -134,6 +134,7 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 + filter: tree:0 - name: Install Node uses: actions/setup-node@v4 diff --git a/docs/shared/tutorials/angular-monorepo.md b/docs/shared/tutorials/angular-monorepo.md index c12b4afbe2..f6b930f32f 100644 --- a/docs/shared/tutorials/angular-monorepo.md +++ b/docs/shared/tutorials/angular-monorepo.md @@ -1289,6 +1289,8 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 + filter: tree:0 + # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun diff --git a/docs/shared/tutorials/gradle.md b/docs/shared/tutorials/gradle.md index c30a9774b2..db6c275aef 100644 --- a/docs/shared/tutorials/gradle.md +++ b/docs/shared/tutorials/gradle.md @@ -367,6 +367,7 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 + filter: tree:0 # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed diff --git a/docs/shared/tutorials/react-monorepo.md b/docs/shared/tutorials/react-monorepo.md index 10b4eefd00..443196ba2d 100644 --- a/docs/shared/tutorials/react-monorepo.md +++ b/docs/shared/tutorials/react-monorepo.md @@ -1124,6 +1124,7 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 + filter: tree:0 # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed diff --git a/docs/shared/tutorials/typescript-packages.md b/docs/shared/tutorials/typescript-packages.md index dc120df06f..9ac8507e95 100644 --- a/docs/shared/tutorials/typescript-packages.md +++ b/docs/shared/tutorials/typescript-packages.md @@ -453,6 +453,8 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 + filter: tree:0 + # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun diff --git a/packages/gradle/src/generators/ci-workflow/__snapshots__/generator.spec.ts.snap b/packages/gradle/src/generators/ci-workflow/__snapshots__/generator.spec.ts.snap index 089d8562c8..cf486e7f42 100644 --- a/packages/gradle/src/generators/ci-workflow/__snapshots__/generator.spec.ts.snap +++ b/packages/gradle/src/generators/ci-workflow/__snapshots__/generator.spec.ts.snap @@ -58,6 +58,7 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 + filter: tree:0 # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed @@ -140,6 +141,7 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 + filter: tree:0 # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed diff --git a/packages/gradle/src/generators/ci-workflow/files/github/.github/workflows/__workflowFileName__.yml.template b/packages/gradle/src/generators/ci-workflow/files/github/.github/workflows/__workflowFileName__.yml.template index 11065638f1..3f7227ec8a 100644 --- a/packages/gradle/src/generators/ci-workflow/files/github/.github/workflows/__workflowFileName__.yml.template +++ b/packages/gradle/src/generators/ci-workflow/files/github/.github/workflows/__workflowFileName__.yml.template @@ -17,6 +17,7 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 + filter: tree:0 # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed diff --git a/packages/workspace/src/generators/ci-workflow/__snapshots__/ci-workflow.spec.ts.snap b/packages/workspace/src/generators/ci-workflow/__snapshots__/ci-workflow.spec.ts.snap index 5e763eaa47..593141623e 100644 --- a/packages/workspace/src/generators/ci-workflow/__snapshots__/ci-workflow.spec.ts.snap +++ b/packages/workspace/src/generators/ci-workflow/__snapshots__/ci-workflow.spec.ts.snap @@ -26,6 +26,7 @@ jobs: steps: - checkout: self fetchDepth: 0 + fetchFilter: tree:0 # Set Azure Devops CLI default settings - bash: az devops configure --defaults organization=$(System.TeamFoundationCollectionUri) project=$(System.TeamProject) displayName: 'Set default Azure DevOps organization and project' @@ -170,6 +171,7 @@ jobs: steps: - uses: actions/checkout@v4 with: + filter: tree:0 fetch-depth: 0 # This enables task distribution via Nx Cloud @@ -215,6 +217,7 @@ jobs: steps: - uses: actions/checkout@v4 with: + filter: tree:0 fetch-depth: 0 # This enables task distribution via Nx Cloud @@ -267,6 +270,7 @@ jobs: steps: - checkout: self fetchDepth: 0 + fetchFilter: tree:0 # Set Azure Devops CLI default settings - bash: az devops configure --defaults organization=$(System.TeamFoundationCollectionUri) project=$(System.TeamProject) displayName: 'Set default Azure DevOps organization and project' @@ -416,6 +420,7 @@ jobs: steps: - uses: actions/checkout@v4 with: + filter: tree:0 fetch-depth: 0 - uses: oven-sh/setup-bun@v1 @@ -457,6 +462,7 @@ jobs: steps: - uses: actions/checkout@v4 with: + filter: tree:0 fetch-depth: 0 - uses: oven-sh/setup-bun@v1 @@ -536,6 +542,7 @@ jobs: steps: - checkout: self fetchDepth: 0 + fetchFilter: tree:0 # Set Azure Devops CLI default settings - bash: az devops configure --defaults organization=$(System.TeamFoundationCollectionUri) project=$(System.TeamProject) displayName: 'Set default Azure DevOps organization and project' @@ -674,6 +681,7 @@ jobs: steps: - uses: actions/checkout@v4 with: + filter: tree:0 fetch-depth: 0 # This enables task distribution via Nx Cloud @@ -717,6 +725,7 @@ jobs: steps: - uses: actions/checkout@v4 with: + filter: tree:0 fetch-depth: 0 # This enables task distribution via Nx Cloud @@ -796,6 +805,7 @@ jobs: steps: - checkout: self fetchDepth: 0 + fetchFilter: tree:0 # Set Azure Devops CLI default settings - bash: az devops configure --defaults organization=$(System.TeamFoundationCollectionUri) project=$(System.TeamProject) displayName: 'Set default Azure DevOps organization and project' @@ -945,6 +955,7 @@ jobs: steps: - uses: actions/checkout@v4 with: + filter: tree:0 fetch-depth: 0 - uses: pnpm/action-setup@v4 @@ -992,6 +1003,7 @@ jobs: steps: - uses: actions/checkout@v4 with: + filter: tree:0 fetch-depth: 0 - uses: pnpm/action-setup@v4 @@ -1077,6 +1089,7 @@ jobs: steps: - checkout: self fetchDepth: 0 + fetchFilter: tree:0 # Set Azure Devops CLI default settings - bash: az devops configure --defaults organization=$(System.TeamFoundationCollectionUri) project=$(System.TeamProject) displayName: 'Set default Azure DevOps organization and project' @@ -1215,6 +1228,7 @@ jobs: steps: - uses: actions/checkout@v4 with: + filter: tree:0 fetch-depth: 0 # This enables task distribution via Nx Cloud @@ -1258,6 +1272,7 @@ jobs: steps: - uses: actions/checkout@v4 with: + filter: tree:0 fetch-depth: 0 # This enables task distribution via Nx Cloud @@ -1337,6 +1352,7 @@ jobs: steps: - checkout: self fetchDepth: 0 + fetchFilter: tree:0 # Set Azure Devops CLI default settings - bash: az devops configure --defaults organization=$(System.TeamFoundationCollectionUri) project=$(System.TeamProject) displayName: 'Set default Azure DevOps organization and project' @@ -1482,6 +1498,7 @@ jobs: steps: - uses: actions/checkout@v4 with: + filter: tree:0 fetch-depth: 0 # This enables task distribution via Nx Cloud @@ -1527,6 +1544,7 @@ jobs: steps: - uses: actions/checkout@v4 with: + filter: tree:0 fetch-depth: 0 # This enables task distribution via Nx Cloud @@ -1579,6 +1597,7 @@ jobs: steps: - checkout: self fetchDepth: 0 + fetchFilter: tree:0 # Set Azure Devops CLI default settings - bash: az devops configure --defaults organization=$(System.TeamFoundationCollectionUri) project=$(System.TeamProject) displayName: 'Set default Azure DevOps organization and project' @@ -1729,6 +1748,7 @@ jobs: steps: - uses: actions/checkout@v4 with: + filter: tree:0 fetch-depth: 0 - uses: oven-sh/setup-bun@v1 @@ -1770,6 +1790,7 @@ jobs: steps: - uses: actions/checkout@v4 with: + filter: tree:0 fetch-depth: 0 - uses: oven-sh/setup-bun@v1 @@ -1849,6 +1870,7 @@ jobs: steps: - checkout: self fetchDepth: 0 + fetchFilter: tree:0 # Set Azure Devops CLI default settings - bash: az devops configure --defaults organization=$(System.TeamFoundationCollectionUri) project=$(System.TeamProject) displayName: 'Set default Azure DevOps organization and project' @@ -1988,6 +2010,7 @@ jobs: steps: - uses: actions/checkout@v4 with: + filter: tree:0 fetch-depth: 0 # This enables task distribution via Nx Cloud @@ -2031,6 +2054,7 @@ jobs: steps: - uses: actions/checkout@v4 with: + filter: tree:0 fetch-depth: 0 # This enables task distribution via Nx Cloud @@ -2110,6 +2134,7 @@ jobs: steps: - checkout: self fetchDepth: 0 + fetchFilter: tree:0 # Set Azure Devops CLI default settings - bash: az devops configure --defaults organization=$(System.TeamFoundationCollectionUri) project=$(System.TeamProject) displayName: 'Set default Azure DevOps organization and project' @@ -2260,6 +2285,7 @@ jobs: steps: - uses: actions/checkout@v4 with: + filter: tree:0 fetch-depth: 0 - uses: pnpm/action-setup@v4 @@ -2307,6 +2333,7 @@ jobs: steps: - uses: actions/checkout@v4 with: + filter: tree:0 fetch-depth: 0 - uses: pnpm/action-setup@v4 @@ -2392,6 +2419,7 @@ jobs: steps: - checkout: self fetchDepth: 0 + fetchFilter: tree:0 # Set Azure Devops CLI default settings - bash: az devops configure --defaults organization=$(System.TeamFoundationCollectionUri) project=$(System.TeamProject) displayName: 'Set default Azure DevOps organization and project' @@ -2531,6 +2559,7 @@ jobs: steps: - uses: actions/checkout@v4 with: + filter: tree:0 fetch-depth: 0 # This enables task distribution via Nx Cloud @@ -2574,6 +2603,7 @@ jobs: steps: - uses: actions/checkout@v4 with: + filter: tree:0 fetch-depth: 0 # This enables task distribution via Nx Cloud diff --git a/packages/workspace/src/generators/ci-workflow/ci-workflow.spec.ts b/packages/workspace/src/generators/ci-workflow/ci-workflow.spec.ts index e89d74e670..c85c8da474 100644 --- a/packages/workspace/src/generators/ci-workflow/ci-workflow.spec.ts +++ b/packages/workspace/src/generators/ci-workflow/ci-workflow.spec.ts @@ -334,6 +334,7 @@ describe('CI Workflow generator', () => { steps: - uses: actions/checkout@v4 with: + filter: tree:0 fetch-depth: 0 # This enables task distribution via Nx Cloud @@ -429,6 +430,7 @@ describe('CI Workflow generator', () => { steps: - checkout: self fetchDepth: 0 + fetchFilter: tree:0 # Set Azure Devops CLI default settings - bash: az devops configure --defaults organization=$(System.TeamFoundationCollectionUri) project=$(System.TeamProject) displayName: 'Set default Azure DevOps organization and project' diff --git a/packages/workspace/src/generators/ci-workflow/files/azure/azure-pipelines.yml__tmpl__ b/packages/workspace/src/generators/ci-workflow/files/azure/azure-pipelines.yml__tmpl__ index e76495f25d..4ff21aeee8 100644 --- a/packages/workspace/src/generators/ci-workflow/files/azure/azure-pipelines.yml__tmpl__ +++ b/packages/workspace/src/generators/ci-workflow/files/azure/azure-pipelines.yml__tmpl__ @@ -23,6 +23,7 @@ jobs: steps: - checkout: self fetchDepth: 0 + fetchFilter: tree:0 # Set Azure Devops CLI default settings - bash: az devops configure --defaults organization=$(System.TeamFoundationCollectionUri) project=$(System.TeamProject) displayName: 'Set default Azure DevOps organization and project' diff --git a/packages/workspace/src/generators/ci-workflow/files/github/.github/workflows/__workflowFileName__.yml__tmpl__ b/packages/workspace/src/generators/ci-workflow/files/github/.github/workflows/__workflowFileName__.yml__tmpl__ index da09f64d5b..07658a566a 100644 --- a/packages/workspace/src/generators/ci-workflow/files/github/.github/workflows/__workflowFileName__.yml__tmpl__ +++ b/packages/workspace/src/generators/ci-workflow/files/github/.github/workflows/__workflowFileName__.yml__tmpl__ @@ -16,7 +16,9 @@ jobs: steps: - uses: actions/checkout@v4 with: + filter: tree:0 fetch-depth: 0 + <% if(packageManager == 'pnpm'){ %> - uses: pnpm/action-setup@v4 with: