Skip to content

Commit

Permalink
use actions summary
Browse files Browse the repository at this point in the history
  • Loading branch information
cenfun committed Jul 4, 2024
1 parent 51867e2 commit 886d3a2
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions github-actions-summary/github-actions-summary.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import path from 'path';
import EC from 'eight-colors';
import { summary } from '@actions/core';

export default (reportData, helper) => {
export default async (reportData, helper) => {

const summaryDir = path.resolve(import.meta.dirname, '../.temp');
if (!fs.existsSync(summaryDir)) {
Expand All @@ -15,6 +15,7 @@ export default (reportData, helper) => {
const summaryFile = path.resolve(summaryDir, 'summary.html');
fs.writeFileSync(summaryFile, '');
process.env.GITHUB_STEP_SUMMARY = summaryFile;
process.env.GITHUB_ACTIONS = 'true';

summary.addHeading(reportData.name, '2');
summary.addRaw(`> ${reportData.dateH} (${reportData.durationH})`);
Expand Down Expand Up @@ -49,9 +50,7 @@ export default (reportData, helper) => {
}
}

summary.write({
overwrite: true
});
await summary.write();

EC.logGreen('[github-actions-summary] completed');

Expand Down

0 comments on commit 886d3a2

Please sign in to comment.