Merge pull request #13 from mswantek68/feature/postreleaseupdates #13
This file contains hidden or 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
| name: DSPM Automation (OIDC) | ||
|
Check failure on line 1 in .github/workflows/daga-automation-oidc.yml
|
||
| on: | ||
| workflow_dispatch: | ||
| permissions: | ||
| id-token: write | ||
| contents: read | ||
| jobs: | ||
| run-automation: | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| SPEC_PATH: ./spec.ci.json | ||
| CERT_PATH: ${{ runner.temp }}/daga-exo-cert.pfx | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| - name: Azure login (federated) | ||
| uses: azure/login@v2 | ||
| with: | ||
| client-id: ${{ secrets.AZURE_FEDERATED_CLIENT_ID }} | ||
| tenant-id: ${{ secrets.AZURE_FEDERATED_TENANT_ID }} | ||
| subscription-id: ${{ secrets.AZURE_FEDERATED_SUBSCRIPTION_ID }} | ||
| enable-AzPSSession: true | ||
| - name: Write DSPM spec from secret | ||
| shell: pwsh | ||
| run: | | ||
| $spec = @' | ||
| ${{ secrets.DAGA_SPEC_JSON }} | ||
| '@ | ||
| if ([string]::IsNullOrWhiteSpace($spec)) { | ||
| throw 'DAGA_SPEC_JSON secret is empty or missing.' | ||
| } | ||
| $spec | Out-File -FilePath $env:SPEC_PATH -Encoding utf8 | ||
| - name: Materialize Exchange certificate | ||
| if: ${{ secrets.DAGA_M365_CERT_PFX != '' }} | ||
| shell: pwsh | ||
| run: | | ||
| $bytes = [Convert]::FromBase64String('${{ secrets.DAGA_M365_CERT_PFX }}') | ||
| [System.IO.File]::WriteAllBytes('${{ env.CERT_PATH }}', $bytes) | ||
| - name: Install PowerShell modules | ||
| shell: pwsh | ||
| run: | | ||
| Install-Module Az -Scope CurrentUser -Force -AllowClobber | ||
| Install-Module Az.Security -Scope CurrentUser -Force -AllowClobber | ||
| Install-Module ExchangeOnlineManagement -Scope CurrentUser -Force | ||
| - name: Run DSPM accelerator | ||
| shell: pwsh | ||
| env: | ||
| DAGA_SPEC_PATH: ${{ env.SPEC_PATH }} | ||
| DAGA_M365_APP_ID: ${{ secrets.DAGA_M365_APP_ID }} | ||
| DAGA_M365_ORGANIZATION: ${{ secrets.DAGA_M365_ORGANIZATION }} | ||
| DAGA_M365_CERT_PATH: ${{ env.CERT_PATH }} | ||
| DAGA_M365_CERT_PASSWORD: ${{ secrets.DAGA_M365_CERT_PASSWORD }} | ||
| run: | | ||
| ./run.ps1 -Tags all -SpecPath $env:DAGA_SPEC_PATH -ConnectM365 | ||
| - name: Cleanup cert | ||
| if: ${{ secrets.DAGA_M365_CERT_PFX != '' }} | ||
| shell: pwsh | ||
| run: | | ||
| if (Test-Path '${{ env.CERT_PATH }}') { | ||
| Remove-Item '${{ env.CERT_PATH }}' -Force | ||
| } | ||