@@ -35,12 +35,59 @@ jobs:
3535 JSON.stringify(${{ github.event.workflow_run }}, null, 2)
3636
3737 # Download reports
38- - uses : ./.github/actions/download-coverage-report
39- with :
40- sha : ${{ github.event.workflow_run.head_sha }}
41- - uses : ./.github/actions/download-lint-report
38+ - name : ' Download reports'
39+ uses : actions/github-script@v6
4240 with :
43- sha : ${{ github.event.workflow_run.head_sha }}
41+ script : |
42+ async function downloadArtifact(artifactName) {
43+ console.log(`Looking for artifact: ${artifactName}`);
44+
45+ let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
46+ owner: context.repo.owner,
47+ repo: context.repo.repo,
48+ run_id: context.payload.workflow_run.id,
49+ });
50+
51+ console.log('Available artifacts:', allArtifacts.data.artifacts.map(a => a.name));
52+
53+ let matchArtifact = allArtifacts.data.artifacts.find((artifact) => {
54+ return artifact.name === artifactName;
55+ });
56+
57+ if (!matchArtifact) {
58+ throw new Error(`Artifact "${artifactName}" not found!`);
59+ }
60+
61+ let download = await github.rest.actions.downloadArtifact({
62+ owner: context.repo.owner,
63+ repo: context.repo.repo,
64+ artifact_id: matchArtifact.id,
65+ archive_format: 'zip',
66+ });
67+
68+ let fs = require('fs');
69+ fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/${artifactName}.zip`, Buffer.from(download.data));
70+
71+ return artifactName;
72+ }
73+
74+ const sha = context.payload.workflow_run.head_sha;
75+
76+ // Download both artifacts
77+ await Promise.all([
78+ downloadArtifact(`ngx-deploy-npm-coverage-report-${sha}`),
79+ downloadArtifact(`lint-report-${sha}`)
80+ ]);
81+
82+ - name : ' Extract reports'
83+ run : |
84+ # Extract coverage report
85+ mkdir -p coverage/packages/ngx-deploy-npm
86+ unzip ngx-deploy-npm-coverage-report-*.zip -d coverage/packages/ngx-deploy-npm
87+
88+ # Extract lint report
89+ mkdir -p reports
90+ unzip lint-report-*.zip -d reports
4491
4592 - name : SonarCloud Scan
4693 uses : sonarsource/sonarcloud-github-action@master
0 commit comments