Skip to content

Commit

Permalink
Switched to use azure login
Browse files Browse the repository at this point in the history
  • Loading branch information
merill committed Dec 9, 2024
1 parent b42f6dc commit 73c0e25
Showing 1 changed file with 26 additions and 16 deletions.
42 changes: 26 additions & 16 deletions .github/workflows/update-microsoft-info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,35 @@ jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Azure AD Workload Identity Federation
uses: nicolonsky/[email protected]
with:
tenant_id: '0817c655-a853-4d8f-9723-3a333b5b9235'
client_id: '38535360-9f3e-4b1e-a41e-b4af46afcb0c'

steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set current date as env variable
run: echo "NOW=$(date +'%Y-%m-%d-T%H%M%S')" >> $GITHUB_ENV

- name: 'Az CLI login'
uses: azure/login@v2
with:
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
client-id: ${{ secrets.AZURE_CLIENT_ID }}
allow-no-subscriptions: true

- name: Generate docs
run: |
Install-Module -Name Microsoft.Graph.Authentication
Install-Module -Name Microsoft.Graph.Applications
$token = $env:ACCESS_TOKEN | ConvertTo-SecureString -AsPlainText
Connect-MgGraph -AccessToken $token
./src/Export-MicrosoftApps.ps1
./src/Export-GraphPermissions.ps1
shell: pwsh
uses: azure/powershell@v2
with:
azPSVersion: "latest"
inlineScript: |
# Get Token
$token = az account get-access-token --resource-type ms-graph
# Connect to Microsoft Graph
$accessToken = ($token | ConvertFrom-Json).accessToken | ConvertTo-SecureString -AsPlainText -Force
Connect-MgGraph -AccessToken $accessToken
# Run export
./src/Export-MicrosoftApps.ps1
./src/Export-GraphPermissions.ps1
- name: Update repo
run: |
Expand Down

0 comments on commit 73c0e25

Please sign in to comment.