File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
.github/actions/get-ado-token Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 31
31
with :
32
32
azPSVersion : " latest"
33
33
inlineScript : |
34
- $accessToken = (Get-AzAccessToken -ResourceUrl "https://${{inputs.organization}}.visualstudio.com").Token
35
- "token=$accessToken" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
34
+ function decodeToken([string]$token) {
35
+ $t = $token.split('.')[1]
36
+ while($t.Length % 4 -ne 0) { $t += '=' }
37
+ ConvertFrom-Json ([System.Text.Encoding]::Ascii.GetString([System.Convert]::FromBase64String($t)))
38
+ }
39
+
40
+ $accessToken = az account get-access-token --resource="https://${{inputs.organization}}.visualstudio.com" --query accessToken
41
+ decodeToken($accessToken)
42
+ "token=$accessToken" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
You can’t perform that action at this time.
0 commit comments