Skip to content

Quality Monitor Comment #69

Quality Monitor Comment

Quality Monitor Comment #69

name: 'Quality Monitor Comment'
on:
workflow_run:
workflows: [ "Quality Monitor Build" ]
types: [ completed ]
permissions:
actions: read
contents: read
pull-requests: write
checks: write
jobs:
comment:
if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'pull_request' }}
runs-on: ubuntu-latest
name: Comment on PR
steps:
- name: Extract PR number and SHA
id: pr
run: |
pr_number='${{ github.event.workflow_run.pull_requests[0].number }}'
echo "number=$pr_number" >> "$GITHUB_OUTPUT"
sha='${{ github.event.workflow_run.head_sha }}'
echo "sha=$sha" >> "$GITHUB_OUTPUT"
- name: Checkout PR
uses: actions/checkout@v5
with:
ref: ${{ steps.pr.outputs.sha }}
- name: Download PR Quality Reports from Quality Monitor Build workflow
uses: dawidd6/action-download-artifact@v11
with:
run_id: ${{ github.event.workflow_run.id }}
name: quality-reports
- name: Read Quality Monitor Configuration
id: quality-monitor
run: echo "json=$(jq -c . .github/quality-monitor.json)" >> "$GITHUB_OUTPUT"
- name: Read Quality Gates Configuration
id: quality-gates
run: echo "json=$(jq -c . .github/quality-gates.json)" >> "$GITHUB_OUTPUT"
- name: Run Quality Monitor and Comment on PR
uses: uhafner/quality-monitor@v3
with:
sha: ${{ steps.pr.outputs.sha }}
config: ${{ steps.quality-monitor.outputs.json }}
quality-gates: ${{ steps.quality-gates.outputs.json }}
pr-number: ${{ steps.pr.outputs.number }}
comments-strategy: REMOVE
show-headers: true
title-metric: none