diff --git a/tools/pipelines/templates/include-policy-check.yml b/tools/pipelines/templates/include-policy-check.yml index 9503095da9fc..3c41dfd4d311 100644 --- a/tools/pipelines/templates/include-policy-check.yml +++ b/tools/pipelines/templates/include-policy-check.yml @@ -50,14 +50,14 @@ stages: ${{ parameters.dependencyInstallCommand }} - ${{ if ne(convertToJson(parameters.checks), '[]') }}: - - ${{ each check in parameters.checks }}: - - task: Npm@1 - displayName: npm run ${{ check }} - inputs: - command: 'custom' - workingDir: ${{ parameters.buildDirectory }} - customCommand: 'run ${{ check }}' - condition: succeededOrFailed() + # - ${{ each check in parameters.checks }}: + # - task: Npm@1 + # displayName: npm run ${{ check }} + # inputs: + # command: 'custom' + # workingDir: ${{ parameters.buildDirectory }} + # customCommand: 'run ${{ check }}' + # condition: succeededOrFailed() - task: Bash@3 displayName: Check for extraneous modified files @@ -72,3 +72,13 @@ stages: echo "##vso[task.logissue type=error]Build should not create extraneous files" exit -1; fi + + # Prune the pnpm store before it's cached. This removes any deps that are not used by the current build. + - task: Bash@3 + displayName: Prune pnpm store + inputs: + targetType: inline + workingDirectory: '${{ parameters.buildDirectory }}' + script: | + set -eu -o pipefail + pnpm store prune