Skip to content

Commit 0719bbf

Browse files
committed
ci(benchmark): write step summary directly to avoid bumping @actions/core
1 parent 0df8c5c commit 0719bbf

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

ci/github-actions/report-benchmark-result-pr.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import { summary } from '@actions/core'
21
import { getOctokit, context } from '@actions/github'
32
import console from 'console'
4-
import { readFileSync } from 'fs'
3+
import { appendFileSync, readFileSync } from 'fs'
54
import process from 'process'
65
import { Item as RegressionItem, collectRegressions } from './benchmark/collect-regressions'
76
import { SelfBenchmarkCategory, parseSelfBenchmarkCategory } from './benchmark/matrix'
@@ -70,10 +69,13 @@ async function main() {
7069
reportBody,
7170
].join('\n')
7271

73-
try {
74-
await summary.addRaw(overallReport, true).write()
75-
} catch (error) {
76-
console.error('Failed to write GitHub step summary:', error)
72+
const stepSummaryPath = env.load('GITHUB_STEP_SUMMARY', '')
73+
if (stepSummaryPath) {
74+
try {
75+
appendFileSync(stepSummaryPath, overallReport + '\n')
76+
} catch (error) {
77+
console.error(`Failed to write GitHub step summary to ${stepSummaryPath}:`, error)
78+
}
7779
}
7880

7981
const auth = env.load('GITHUB_TOKEN')

0 commit comments

Comments
 (0)