Skip to content

Commit 4d95eb5

Browse files
authored
chore(ci): post benchmark summary when from fork (#2098)
### Proposed Changes https://github.com/opentdf/platform/actions/runs/14622447666?pr=2098#summary-41025693259 ### Checklist - [ ] I have added or updated unit tests - [ ] I have added or updated integration tests (if appropriate) - [ ] I have added or updated documentation ### Testing Instructions
1 parent c97a315 commit 4d95eb5

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

.github/workflows/checks.yaml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ jobs:
246246
} >> "$GITHUB_ENV"
247247
248248
- name: save benchmark results as a comment
249-
if: github.event_name == 'pull_request'
249+
if: github.event_name == 'pull_request' && !github.event.pull_request.head.repo.fork
250250
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea #v7.0.1
251251
with:
252252
script: |
@@ -260,6 +260,17 @@ jobs:
260260
body,
261261
});
262262
263+
- name: save benchmark results as a step summary
264+
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork
265+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea #v7.0.1
266+
with:
267+
script: |
268+
const fs = require('fs');
269+
const metricsOutput = process.env.BENCHMARK_METRICS_OUTPUT || '## Standard Benchmark Skipped or Failed';
270+
const bulkOutput = process.env.BENCHMARK_BULK_OUTPUT || '## Bulk Benchmark Skipped or Failed';
271+
const summaryContent = `${metricsOutput}\n\n${bulkOutput}`;
272+
fs.appendFileSync(process.env.GITHUB_STEP_SUMMARY, summaryContent + '\n');
273+
263274
image:
264275
name: image build
265276
runs-on: ubuntu-22.04

0 commit comments

Comments
 (0)