-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restructure a few bits to use the composite approach (#339)
* Restructure a few bits to use the composite approach * Update .github/actions/oidc-auth-flow/action.yml
- Loading branch information
1 parent
c07a5e5
commit 52f0c0f
Showing
3 changed files
with
43 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Azure OIDC auth flow | ||
description: "Azure OpenID Connect authentication flow" | ||
|
||
inputs: | ||
client-id: | ||
description: "The Azure AD application client ID" | ||
required: true | ||
tenant-id: | ||
description: "The Azure AD tenant ID" | ||
required: true | ||
audience: | ||
description: "The audience for the access token" | ||
required: true | ||
|
||
outputs: | ||
access-token: | ||
description: "The Azure OIDC bearer access token" | ||
value: ${{ steps.api-access.outputs.AZURE_ACCESS_TOKEN }} | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Azure OpenID Connect | ||
uses: azure/login@v2 | ||
with: | ||
client-id: ${{ inputs.client-id }} | ||
tenant-id: ${{ inputs.tenant-id }} | ||
audience: ${{ inputs.audience }} | ||
allow-no-subscriptions: true | ||
|
||
- name: OSMP API access | ||
id: api-access | ||
shell: bash | ||
run: | | ||
TOKEN=$(az account get-access-token --query 'accessToken' -o tsv --resource ${{ inputs.audience }}) | ||
echo "AZURE_ACCESS_TOKEN=$(echo $TOKEN)" >> $GITHUB_OUTPUT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters