From 7f9ceee0aa80aead9a7c859a6a390174ae08f1c2 Mon Sep 17 00:00:00 2001 From: Fabio Cavalcante Date: Fri, 31 Jul 2026 09:13:17 -0700 Subject: [PATCH] build: onboard npm restores to CFS Route repository dependency restores through the azfunc public Central Feed Service feed and authenticate each reusable Azure Pipelines npm path. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 71244b0f-e67a-45fc-8442-4a7b079bfe2c --- .npmrc | 2 ++ azure-pipelines/templates/build.yml | 4 ++++ azure-pipelines/templates/npm-publish-steps.yml | 5 +++++ azure-pipelines/templates/test.yml | 4 ++++ 4 files changed, 15 insertions(+) create mode 100644 .npmrc diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..46e8008 --- /dev/null +++ b/.npmrc @@ -0,0 +1,2 @@ +registry=https://pkgs.dev.azure.com/azfunc/public/_packaging/upstream-public/npm/registry/ +@azure:registry=https://pkgs.dev.azure.com/azfunc/public/_packaging/upstream-public/npm/registry/ diff --git a/azure-pipelines/templates/build.yml b/azure-pipelines/templates/build.yml index 2b8a464..bd862c2 100644 --- a/azure-pipelines/templates/build.yml +++ b/azure-pipelines/templates/build.yml @@ -14,6 +14,10 @@ jobs: inputs: versionSpec: 20.x displayName: 'Install Node.js' + - task: npmAuthenticate@0 + displayName: 'Authenticate to Central Feed Service' + inputs: + workingFile: '$(Build.SourcesDirectory)/.npmrc' - script: npm ci displayName: 'npm ci' - script: npm audit --production diff --git a/azure-pipelines/templates/npm-publish-steps.yml b/azure-pipelines/templates/npm-publish-steps.yml index 90bb948..10b0e11 100644 --- a/azure-pipelines/templates/npm-publish-steps.yml +++ b/azure-pipelines/templates/npm-publish-steps.yml @@ -9,6 +9,11 @@ steps: inputs: versionSpec: 18.x + - task: npmAuthenticate@0 + displayName: 'Authenticate to Central Feed Service' + inputs: + workingFile: '$(Build.SourcesDirectory)/.npmrc' + - script: npm ci displayName: 'npm ci' diff --git a/azure-pipelines/templates/test.yml b/azure-pipelines/templates/test.yml index 22f1476..a9a856f 100644 --- a/azure-pipelines/templates/test.yml +++ b/azure-pipelines/templates/test.yml @@ -17,6 +17,10 @@ jobs: inputs: versionSpec: $(NODE_VERSION) displayName: 'Install Node.js' + - task: npmAuthenticate@0 + displayName: 'Authenticate to Central Feed Service' + inputs: + workingFile: '$(Build.SourcesDirectory)/.npmrc' - script: npm ci displayName: 'npm ci' - script: npm run build