Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
bokuweb committed Oct 22, 2023
1 parent ec0f74c commit 5c11f3c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/client.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as github from '@actions/github';
import * as artifact from '@actions/artifact';
import { backOff } from 'exponential-backoff';
import { summary } from '@actions/core';

import { Repository } from './repository';
import { workspace } from './path';
Expand Down Expand Up @@ -50,5 +51,8 @@ export const createClient = (repository: Repository, octokit: Octokit) => {
);
return;
},
summary: async (raw: string): Promise<void> => {
summary.addRaw(raw).write();
},
};
};
9 changes: 8 additions & 1 deletion src/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import cpx from 'cpx';
import { sync as globSync } from 'glob';
import makeDir from 'make-dir';
import Zip from 'adm-zip';
import { summary } from '@actions/core';

import { log } from './logger';
import { Config } from './config';
Expand Down Expand Up @@ -103,7 +104,11 @@ type CommentClient = {
postComment: (issueNumber: number, comment: string) => Promise<void>;
};

type Client = CommentClient & DownloadClient & UploadClient & RunClient;
type SummaryClient = {
summary: (raw: string) => Promise<void>;
};

type Client = CommentClient & DownloadClient & UploadClient & RunClient & SummaryClient;

export const run = async (event: Event, runId: number, sha: string, client: Client, config: Config) => {
// Setup directory for artifact and copy images.
Expand Down Expand Up @@ -173,4 +178,6 @@ export const run = async (event: Event, runId: number, sha: string, client: Clie
});

await client.postComment(event.number, comment);

await client.summary(comment);
};

0 comments on commit 5c11f3c

Please sign in to comment.