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 8f7b9fb7cc326..d937faca97a9b 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 @@ -265,6 +265,8 @@ jobs: # - script: npx nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="build" - script: npm ci + - script: git branch --track main origin/main + condition: eq(variables['Build.Reason'], 'PullRequest') - script: npx nx-cloud record -- nx format:check --base=$(BASE_SHA) --head=$(HEAD_SHA) - script: npx nx affected --base=$(BASE_SHA) --head=$(HEAD_SHA) -t lint test build @@ -299,6 +301,7 @@ pipelines: - step: name: 'Build and test affected apps on "main" branch changes' script: + - export NX_BRANCH=$BITBUCKET_BRANCH # Connect your workspace on my.nx.app and uncomment this to enable task distribution. # The "--stop-agents-after" is optional, but allows idle agents to shut down once the "build" targets have been requested # - npx nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="build" @@ -331,6 +334,10 @@ jobs: - nx/set-shas: main-branch-name: 'main' + # Required for nx affected if we're on a branch + - run: git branch --track main origin/main + condition: eq(variables['Build.Reason'], 'PullRequest') + - run: npx nx-cloud record -- nx format:check --base=$NX_BASE --head=$NX_HEAD - run: npx nx affected --base=$NX_BASE --head=$NX_HEAD -t lint test build @@ -376,6 +383,9 @@ jobs: - run: npm ci - uses: nrwl/nx-set-shas@v4 + - run: git branch --track main origin/main + if: \${{ github.event_name == 'pull_request' }} + - run: npx nx-cloud record -- nx format:check - run: npx nx affected -t lint test build " @@ -414,6 +424,9 @@ jobs: - run: npm ci - uses: nrwl/nx-set-shas@v4 + - run: git branch --track main origin/main + if: \${{ github.event_name == 'pull_request' }} + - run: npx nx-cloud record -- nx format:check - run: npx nx affected -t lint test build " diff --git a/scripts/check-lock-files.js b/scripts/check-lock-files.js index 203505c78a8fb..e4584d82d54ea 100644 --- a/scripts/check-lock-files.js +++ b/scripts/check-lock-files.js @@ -7,6 +7,11 @@ function checkLockFiles() { 'Invalid occurence of "package-lock.json" file. Please remove it and use only "pnpm-lock.yaml"' ); } + if (fs.existsSync('bun.lockb')) { + errors.push( + 'Invalid occurence of "bun.lockb" file. Please remove it and use only "pnpm-lock.yaml"' + ); + } if (fs.existsSync('yarn.lock')) { errors.push( 'Invalid occurence of "yarn.lock" file. Please remove it and use only "pnpm-lock.yaml"'