.Platform - Manage workflow issue #604
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 issues for failing workflows | |
| name: .Platform - Manage workflow issue | |
| on: | |
| schedule: | |
| - cron: "30 5 * * *" # Every day at 5:30 am | |
| workflow_dispatch: | |
| inputs: | |
| whatIf: | |
| type: boolean | |
| description: "Simulate execution" | |
| required: false | |
| default: false | |
| env: | |
| workflowPath: ".github/workflows/platform.manage-workflow-issue.yml" | |
| jobs: | |
| job_initialize_pipeline: | |
| runs-on: ubuntu-latest | |
| name: "Initialize pipeline" | |
| steps: | |
| - name: "Checkout" | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: "Set input parameters to output variables" | |
| id: get-workflow-param | |
| uses: ./.github/actions/templates/avm-getWorkflowInput | |
| with: | |
| workflowPath: "${{ env.workflowPath}}" | |
| outputs: | |
| workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} | |
| manage-issues: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| issues: write | |
| needs: | |
| - job_initialize_pipeline | |
| steps: | |
| - name: "Checkout" | |
| uses: actions/checkout@v5 | |
| 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: Manage issues | |
| shell: pwsh | |
| env: | |
| GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} | |
| run: | | |
| # Load used functions | |
| . (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'platform' 'Set-AvmGitHubIssueForWorkflow.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 | |
| Set-AvmGitHubIssueForWorkflow @functionInput |