SLO Report #228
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: | |
| publish-slo-report: | |
| if: github.event.workflow_run.conclusion != 'skipped' | |
| runs-on: ubuntu-latest | |
| name: Publish YDB SLO Report | |
| permissions: | |
| actions: read | |
| checks: write | |
| contents: read | |
| pull-requests: write | |
| steps: | |
| - name: Publish YDB SLO Report | |
| uses: ydb-platform/ydb-slo-action/report@v2 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| github_run_id: ${{ github.event.workflow_run.id }} | |
| remove-slo-label: | |
| needs: publish-slo-report | |
| if: github.event.workflow_run.conclusion != 'skipped' && github.event.workflow_run.event == 'pull_request' | |
| runs-on: ubuntu-latest | |
| name: Remove SLO Label | |
| permissions: | |
| pull-requests: write | |
| steps: | |
| - name: Remove SLO label from PR | |
| env: | |
| PRS: ${{ toJSON(github.event.workflow_run.pull_requests) }} | |
| REPO: ${{ github.event.workflow_run.repository.full_name }} | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| set -euo pipefail | |
| PR=$(jq -r '.[0].number' <<<"$PRS") | |
| if [ "$PR" = "null" ] || [ -z "$PR" ]; then | |
| echo "No pull requests associated with this workflow run" | |
| exit 0 | |
| fi | |
| gh pr edit "$PR" --repo "$REPO" --remove-label SLO || { | |
| echo "SLO label not found on PR #${PR}, skipping" | |
| } |