Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/actions/nuget-auth/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Authenticate to NuGet
description: Equivalent of Azure Pipelines' NuGetAuthenticate@1 — authenticates to Azure DevOps feeds referenced in nuget.config via OIDC.

runs:
using: composite
steps:
- uses: azure/login@v2
with:
client-id: 5786d1fb-187e-4ca9-9a81-ab89ea278986
tenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47
allow-no-subscriptions: true

- name: Export VSS_NUGET_ACCESSTOKEN
shell: bash
run: |
TOKEN=$(az account get-access-token \
--resource 499b84ac-1321-427f-aa17-267ca6975798 \
--query accessToken -o tsv)
echo "::add-mask::$TOKEN"
echo "VSS_NUGET_ACCESSTOKEN=$TOKEN" >> "$GITHUB_ENV"
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ jobs:
core: ${{ steps.filter.outputs.core }}
steps:
- uses: actions/checkout@v7
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- uses: ./.github/actions/nuget-auth

# cspell:ignore dorny
Comment on lines +31 to 33

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to authenticate for this feed? Is that not going to break every 3rd party user

- uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4
id: filter
Expand Down
3 changes: 3 additions & 0 deletions eng/tsp-core/pipelines/templates/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ parameters:
default: $(Pipeline.Workspace)/.pnpm-store

steps:
# Need to authenticate so our pipeline can update packages in the feed.
- task: NuGetAuthenticate@1

- task: UseNode@1
displayName: Install Node.js
retryCountOnTaskFailure: 3
Expand Down
3 changes: 2 additions & 1 deletion packages/typespec-vs/nuget.config

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does the http-client-csharp emitter not need changes too?

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<configuration>
<packageSources>
<clear />
<add key="nuget" value="https://api.nuget.org/v3/index.json" />
<!-- Do not add any additional feeds if new packages are needed they need to come from our azure-sdk-for-net DevOps feed which has an upstream set to nuget.org -->
<add key="azure-sdk-for-net" value="https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json" />
</packageSources>
</configuration>
Loading