Skip to content

Commit 007626a

Browse files
authored
Using Azure Entra ID auth for connecting to ADO cargo feeds (#2)
1 parent f5da1e8 commit 007626a

File tree

1 file changed

+40
-2
lines changed

1 file changed

+40
-2
lines changed

action.yml

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,15 @@ inputs:
88
description: "(Default: 1.74.0) Rust toolchain specification to install - see https://rust-lang.github.io/rustup/concepts/toolchains.html#toolchain-specification"
99
required: false
1010
default: "1.74.0"
11+
azure-client-id:
12+
description: 'ClientId of the Azure Service principal created.'
13+
required: true
14+
azure-tenant-id:
15+
description: 'TenantId of the Azure Service principal created.'
16+
required: true
17+
azure-subscription-id:
18+
description: 'Azure subscriptionId'
19+
required: false
1120

1221
runs:
1322
using: composite
@@ -24,9 +33,30 @@ runs:
2433

2534
### Linux setup ###
2635

36+
- name: Install azure-cli (Linux mariner)
37+
if: ${{ runner.os == 'Linux' }}
38+
run: |
39+
if command -v dnf > /dev/null 2>&1; then
40+
sudo dnf install azure-cli -y
41+
fi
42+
shell: bash
43+
44+
- name: Azure CLI login (Linux)
45+
uses: azure/login@v1
46+
if: runner.os == 'Linux'
47+
with:
48+
client-id: ${{ inputs.azure-client-id }}
49+
tenant-id: ${{ inputs.azure-tenant-id }}
50+
subscription-id: ${{ inputs.azure-subscription-id }}
51+
2752
- name: Cargo login
2853
if: ${{ runner.os == 'Linux' }}
29-
run: just cargo-login-ci
54+
run: just cargo-login
55+
shell: bash
56+
57+
- name: Cargo login
58+
if: ${{ runner.os == 'Linux' }}
59+
run: just cargo-login
3060
shell: bash
3161

3262
- name: Install clang-tools (Linux mariner)
@@ -84,9 +114,17 @@ runs:
84114

85115
### Windows setup ###
86116

117+
- name: Azure CLI login (Window)
118+
uses: azure/login@v1
119+
if: runner.os == 'Windows'
120+
with:
121+
client-id: ${{ inputs.azure-client-id }}
122+
tenant-id: ${{ inputs.azure-tenant-id }}
123+
subscription-id: ${{ inputs.azure-subscription-id }}
124+
87125
- name: Cargo login (Windows)
88126
if: ${{ (runner.os == 'Windows') }}
89-
run: just cargo-login-ci-windows
127+
run: just cargo-login
90128
shell: pwsh
91129

92130
- name: Enable WHP on Windows

0 commit comments

Comments
 (0)