.Platform - create AzAdvertizer diff issue #3
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
| # Workflow for creating an issue, if data in AzAdvertizer (PSRule, APRL and Advisor) changed compared to the last run. | |
| name: .Platform - create AzAdvertizer diff issue | |
| on: | |
| schedule: | |
| - cron: "0 3 * * 0" # Every sunday at 3:00 am | |
| workflow_dispatch: | |
| inputs: | |
| whatIf: | |
| type: boolean | |
| description: "Simulate execution" | |
| required: false | |
| default: false | |
| env: | |
| workflowPath: ".github/workflows/platform.new-AzAdvertizer-diff-issue.yml" | |
| jobs: | |
| create-diff-issue: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| issues: write | |
| steps: | |
| - name: "Checkout" | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/create-github-app-token@v2 | |
| id: generate-token | |
| with: | |
| app-id: ${{ secrets.TEAM_LINTER_APP_ID }} | |
| private-key: ${{ secrets.TEAM_LINTER_PRIVATE_KEY }} | |
| - name: Create diff issue | |
| shell: pwsh | |
| env: | |
| GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} | |
| run: | | |
| # Load used functions | |
| . (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'platform' 'New-AzAdvertizerDiffIssue.ps1') | |
| $functionInput = @{ | |
| RepositoryOwner = "${{ github.repository_owner }}" | |
| RepositoryName = "${{ github.event.repository.name }}" | |
| RepoRoot = $env:GITHUB_WORKSPACE | |
| WhatIf = [System.Convert]::ToBoolean((('${{ needs.job_initialize_pipeline.outputs.workflowInput }}') | ConvertFrom-Json).whatIf) | |
| } | |
| Write-Verbose "Invoke task with" -Verbose | |
| Write-Verbose ($functionInput | ConvertTo-Json | Out-String) -Verbose | |
| New-AzAdvertizerDiffIssue @functionInput | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: AzAdvertizerData.csv | |
| path: ./new/AzAdvertizerData.csv |