@@ -69,14 +69,18 @@ jobs:
6969 const artifacts = await github.paginate(github.rest.actions.listArtifactsForRepo, { ...context.repo, per_page: 100 });
7070 for (const artifact of artifacts) {
7171 if (artifact.name !== 'factorize-app-assets' || artifact.expired || !artifact.workflow_run) continue;
72- const { data: run } = await github.rest.actions.getWorkflowRun({ ...context.repo, run_id: artifact.workflow_run.id });
73- const jobs = await github.paginate(github.rest.actions.listJobsForWorkflowRun, { ...context.repo, run_id: run.id, per_page: 100 });
74- if (!isTrustedAppRelease(artifact, run, jobs, `${context.repo.owner}/${context.repo.repo}`)) continue;
75- const { data } = await github.rest.actions.downloadArtifact({ ...context.repo, artifact_id: artifact.id, archive_format: 'zip' });
76- const archive = `${process.env.RUNNER_TEMP}/factorize-assets-${artifact.id}.zip`;
77- fs.writeFileSync(archive, Buffer.from(data));
78- execFileSync('python3', ['scripts/retain-app-assets.py', archive, 'packages/app/dist'], { stdio: 'inherit' });
79- fs.unlinkSync(archive);
72+ try {
73+ const { data: run } = await github.rest.actions.getWorkflowRun({ ...context.repo, run_id: artifact.workflow_run.id });
74+ const jobs = await github.paginate(github.rest.actions.listJobsForWorkflowRun, { ...context.repo, run_id: run.id, per_page: 100 });
75+ if (!isTrustedAppRelease(artifact, run, jobs, `${context.repo.owner}/${context.repo.repo}`)) continue;
76+ const { data } = await github.rest.actions.downloadArtifact({ ...context.repo, artifact_id: artifact.id, archive_format: 'zip' });
77+ const archive = `${process.env.RUNNER_TEMP}/factorize-assets-${artifact.id}.zip`;
78+ fs.writeFileSync(archive, Buffer.from(data));
79+ execFileSync('python3', ['scripts/retain-app-assets.py', archive, 'packages/app/dist'], { stdio: 'inherit' });
80+ fs.unlinkSync(archive);
81+ } catch (error) {
82+ core.warning(`Skipping unavailable production asset artifact ${artifact.id}: ${error.message}`);
83+ }
8084 }
8185 - name : Apply database migrations
8286 run : npm run db:migrate --workspace=factorize
0 commit comments