From 033ef627d9547feeb1018339244b9e426ecef463 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 5 Aug 2026 02:49:06 +0000 Subject: [PATCH 1/3] Port networkIsolationPolicy setting from openapi-diff PR #504 Co-authored-by: mikeharder <9459391+mikeharder@users.noreply.github.com> --- eng/1es-redirect.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/eng/1es-redirect.yml b/eng/1es-redirect.yml index ee863a7..463c9cc 100644 --- a/eng/1es-redirect.yml +++ b/eng/1es-redirect.yml @@ -36,6 +36,7 @@ extends: - 1ES.PT.Tag-refs/tags/canary settings: skipBuildTagsForGitHubPullRequests: true + networkIsolationPolicy: Permissive, CFSClean sdl: git: longpaths: true From 4d5727d87ccbddd5b1a91442071b6643532ba416 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 5 Aug 2026 03:10:08 +0000 Subject: [PATCH 2/3] Port authenticated npmrc template from openapi-diff PR #488 Co-authored-by: mikeharder <9459391+mikeharder@users.noreply.github.com> --- .../steps/create-authenticated-npmrc.yml | 41 +++++++++++++++++++ eng/test-steps.yml | 2 + 2 files changed, 43 insertions(+) create mode 100644 eng/common/pipelines/templates/steps/create-authenticated-npmrc.yml diff --git a/eng/common/pipelines/templates/steps/create-authenticated-npmrc.yml b/eng/common/pipelines/templates/steps/create-authenticated-npmrc.yml new file mode 100644 index 0000000..3fa699b --- /dev/null +++ b/eng/common/pipelines/templates/steps/create-authenticated-npmrc.yml @@ -0,0 +1,41 @@ +parameters: + - name: npmrcPath + type: string + # When empty, defaults to the agent user's .npmrc ($HOME/.npmrc on + # Linux/macOS, %USERPROFILE%\.npmrc on Windows) so every subsequent + # npm / pnpm / npx call in the job inherits the registry + auth. + default: "" + - name: registryUrl + type: string + default: "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/" + - name: CustomCondition + type: string + default: succeeded() + - name: ServiceConnection + type: string + default: "" + +steps: + - pwsh: | + $npmrcPath = '${{ parameters.npmrcPath }}' + if (-not $npmrcPath) { $npmrcPath = Join-Path $HOME '.npmrc' } + + Write-Host "Creating .npmrc file $npmrcPath for registry ${{ parameters.registryUrl }}" + $parentFolder = Split-Path -Path $npmrcPath -Parent + + if ($parentFolder -and -not (Test-Path $parentFolder)) { + Write-Host "Creating folder $parentFolder" + New-Item -Path $parentFolder -ItemType Directory | Out-Null + } + + "registry=${{ parameters.registryUrl }}" | Out-File $npmrcPath + Write-Host "##vso[task.setvariable variable=resolvedNpmrcPath]$npmrcPath" + displayName: "Create .npmrc" + condition: ${{ parameters.CustomCondition }} + + - task: npmAuthenticate@0 + displayName: Authenticate .npmrc + condition: ${{ parameters.CustomCondition }} + inputs: + workingFile: $(resolvedNpmrcPath) + azureDevOpsServiceConnection: ${{ parameters.ServiceConnection }} diff --git a/eng/test-steps.yml b/eng/test-steps.yml index a7fd45a..e37ca1f 100644 --- a/eng/test-steps.yml +++ b/eng/test-steps.yml @@ -8,6 +8,8 @@ steps: inputs: versionSpec: ${{ parameters.version }} + - template: /eng/common/pipelines/templates/steps/create-authenticated-npmrc.yml + - script: npm ci displayName: 'npm ci' From ad31953124b5aa72aac4560e93ad51a6c9250d03 Mon Sep 17 00:00:00 2001 From: Mike Harder Date: Wed, 5 Aug 2026 14:45:20 -0700 Subject: [PATCH 3/3] Add template for creating authenticated npmrc --- azure-pipelines.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index fd50bbd..2f5a54c 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -23,6 +23,8 @@ extends: inputs: version: 24.x + - template: /eng/common/pipelines/templates/steps/create-authenticated-npmrc.yml + - script: npm ci displayName: 'npm ci'