Skip to content

Commit

Permalink
feat(artifact): add bundle id to artifact name
Browse files Browse the repository at this point in the history
  • Loading branch information
haydenbleasel committed Jun 20, 2024
1 parent 3d0e640 commit 502acd5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export async function run(): Promise<void> {
const { instanceId, bundleId } = await setupDevice(pathTypes);
const report = await runMatrix(instanceId, bundleId, pathTypes);
await cleanup(instanceId);
await storeReportInArtifacts(report);
await storeReportInArtifacts(report, bundleId);
} catch (error) {
// Fail the workflow run if an error occurs
if (error instanceof Error) {
Expand Down Expand Up @@ -187,14 +187,14 @@ export async function pollAssessmentForStatus(
return actualStatus;
}

async function storeReportInArtifacts(report: string): Promise<void> {
async function storeReportInArtifacts(report: string, bundleId: string): Promise<void> {
const workspaceDir = process.env.GITHUB_WORKSPACE as string;
const reportPath = path.join(workspaceDir, 'report.html');
fs.writeFileSync(reportPath, report);

const artifact = new DefaultArtifactClient();

const { id } = await artifact.uploadArtifact('matrix-report', ['./report.html'], workspaceDir);
const { id } = await artifact.uploadArtifact(`matrix-report-${bundleId}`, ['./report.html'], workspaceDir);
if (!id) {
throw new Error('Failed to upload MATRIX report artifact!');
}
Expand Down

0 comments on commit 502acd5

Please sign in to comment.