@@ -20,45 +20,14 @@ jobs:
2020 steps :
2121 - name : Checkout PR
2222 uses : actions/checkout@v6
23- - name : Download reference reports from main branch
24- id : download-reference
25- uses : dawidd6/action-download-artifact@v21
23+ - name : Install jq and unzip
24+ run : sudo apt-get update && sudo apt-get install -y jq unzip
25+ - name : Download reference reports from main branch pipeline run
26+ id : reference
27+ uses : ./.github/actions/download-reference
2628 with :
27- workflow : quality-monitor-build.yml
28- branch : main
29- name : quality-reports
30- path : reference-reports
31- check_artifacts : true
32- if_no_artifact_found : ignore
33- - name : Display reference artifact info
34- id : reference-info
35- run : |
36- echo "Artifact details: ${{ steps.download-reference.outputs.artifacts }}"
37- run_id=$(echo '${{ steps.download-reference.outputs.artifacts }}' | jq -r '.[0].workflow_run.id // "unknown"')
38- run_number=$(echo '${{ steps.download-reference.outputs.artifacts }}' | jq -r '.[0].workflow_run.run_number // "unknown"')
39- head_sha=$(echo '${{ steps.download-reference.outputs.artifacts }}' | jq -r '.[0].workflow_run.head_sha // "unknown"')
40- echo "Downloaded artifact from Run ID: $run_id"
41- echo "Downloaded artifact from Run Number: $run_number"
42- echo "Downloaded artifact from Commit SHA: $head_sha"
43-
44- if [ "$run_id" != "unknown" ]; then
45- run_url="https://github.com/${{ github.repository }}/actions/runs/$run_id"
46- echo "Run URL: $run_url"
47- echo "run_url=$run_url" >> "$GITHUB_ENV"
48- echo "run_url=$run_url" >> "$GITHUB_OUTPUT"
49- fi
50-
51- if [ "$head_sha" != "unknown" ]; then
52- commit_url="https://github.com/${{ github.repository }}/commit/$head_sha"
53- echo "Commit URL: $commit_url"
54- echo "commit_url=$commit_url" >> "$GITHUB_ENV"
55- echo "commit_url=$commit_url" >> "$GITHUB_OUTPUT"
56- fi
57-
58- echo "run_id=$run_id" >> "$GITHUB_ENV"
59- echo "run_number=$run_number" >> "$GITHUB_ENV"
60- echo "head_sha=$head_sha" >> "$GITHUB_ENV"
61- - name : Fetch reports from dependency check and quality monitor workflows
29+ repository : ${{ github.repository }}
30+ - name : Download current reports from dependency check and quality monitor workflows
6231 env :
6332 REPO : ${{ github.repository }}
6433 HEAD_SHA : ${{ github.event.workflow_run.head_sha }}
8453 fi
8554 echo "PR number from reports/pr-number.txt: $pr_number"
8655 echo "number=$pr_number" >> "$GITHUB_OUTPUT"
87- - name : Install jq and unzip
88- run : sudo apt-get update && sudo apt-get install -y jq unzip
8956 - name : Prepare environment
9057 env :
9158 HEAD_SHA : ${{ github.event.workflow_run.head_sha }}
10774 config : ${{ steps.quality-monitor.outputs.json }}
10875 quality-gates : ${{ steps.quality-gates.outputs.json }}
10976 pr-number : ${{ steps.pr.outputs.number }}
110- reference-commit-url : ${{ steps.reference-info .outputs.commit_url }}
111- reference-run-url : ${{ steps.reference-info .outputs.run_url }}
77+ reference-commit-url : ${{ steps.reference.outputs.commit_url }}
78+ reference-run-url : ${{ steps.reference.outputs.run_url }}
11279 comments-strategy : REMOVE
11380 show-headers : true
11481 title-metric : none
0 commit comments