slo-report #685
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: slo-report | |
| on: | |
| workflow_run: | |
| workflows: ["SLO"] | |
| types: | |
| - completed | |
| jobs: | |
| ydb-slo-action-report: | |
| runs-on: ubuntu-latest | |
| name: Publish YDB SLO Report | |
| permissions: | |
| checks: write | |
| contents: read | |
| pull-requests: write | |
| steps: | |
| - name: Publish YDB SLO Report | |
| uses: ydb-platform/ydb-slo-action/report@13c687b7d4b2879da79dd12932dee0ed2b65dd1c | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| github_run_id: ${{ github.event.workflow_run.id }} | |
| remove-slo-label: | |
| if: always() && github.event.workflow_run.event == 'pull_request' | |
| name: Remove SLO Label | |
| needs: ydb-slo-action-report | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pull-requests: write | |
| steps: | |
| - name: Remove SLO label from PR | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const pullRequests = context.payload.workflow_run.pull_requests; | |
| if (pullRequests && pullRequests.length > 0) { | |
| for (const pr of pullRequests) { | |
| try { | |
| await github.rest.issues.removeLabel({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: pr.number, | |
| name: 'SLO' | |
| }); | |
| console.log(`Removed SLO label from PR #${pr.number}`); | |
| } catch (error) { | |
| if (error.status === 404) { | |
| console.log(`SLO label not found on PR #${pr.number}, skipping`); | |
| } else { | |
| throw error; | |
| } | |
| } | |
| } | |
| } else { | |
| console.log('No pull requests associated with this workflow run'); | |
| } |