Quality Monitor Comment #119
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: 'Quality Monitor Comment' | |
| on: | |
| workflow_run: | |
| workflows: ['Quality Monitor', 'Dependency Check'] | |
| types: [completed] | |
| permissions: | |
| actions: read | |
| contents: read | |
| pull-requests: write | |
| checks: write | |
| jobs: | |
| comment: | |
| if: ${{ github.event.workflow_run.event == 'push' && github.event.workflow_run.head_branch == 'main' }} | |
| runs-on: ubuntu-latest | |
| name: Comment main branch | |
| steps: | |
| - name: Checkout main branch | |
| uses: actions/checkout@v6 | |
| - name: Install jq and unzip | |
| run: sudo apt-get update && sudo apt-get install -y jq unzip | |
| - name: Prepare environment | |
| env: | |
| HEAD_SHA: ${{ github.event.workflow_run.head_sha }} | |
| REPO: ${{ github.repository }} | |
| TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| echo "HEAD_SHA=$HEAD_SHA" | |
| echo "REPO=$REPO" | |
| - name: Fetch reports from dependency check and quality monitor workflows | |
| env: | |
| REPO: ${{ github.repository }} | |
| HEAD_SHA: ${{ github.event.workflow_run.head_sha }} | |
| TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| OTHER_WORKFLOWS: "quality-monitor-build.yml,dependency-check.yml" | |
| ARTIFACT_NAMES: "quality-reports,dependency-report" | |
| run: | | |
| chmod +x ./.github/scripts/fetch-artifacts.sh | |
| ./.github/scripts/fetch-artifacts.sh | |
| - name: List downloaded reports | |
| run: | | |
| mkdir -p reports/target | |
| mv artifacts/*/target/* reports/target | |
| ls -la reports/target/* || true | |
| - 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@v4 | |
| with: | |
| config: ${{ steps.quality-monitor.outputs.json }} | |
| quality-gates: ${{ steps.quality-gates.outputs.json }} | |
| show-headers: true | |
| title-metric: none |