Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ jobs:
include_passed: true
detailed_summary: true
summary: '<table><thead><tr><th> Application (src/applications) </th></tr></thead><tbody><tr><td> test </td></tr></tbody></table>'
job_summary_text: |
# Test Header for Example Junit Test Report

This is some custom body to show in the summary.
check_title_template: '{{SUITE_NAME}} | {{TEST_NAME}}'
annotate_only: ${{ github.event_name == 'workflow_dispatch' }}

Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ inputs:
description: 'Enables the publishing of a JOB_SUMMARY with the report.'
required: false
default: 'true'
job_summary_text:
description: 'Additional text to include in the job summary prior to the tables'
required: false
default: ''
detailed_summary:
description: 'Include table with all test results in summary'
required: false
Expand Down
9 changes: 7 additions & 2 deletions dist/index.js

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

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion src/annotator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,14 @@ export async function attachSummary(
table: SummaryTableRow[],
detailsTable: SummaryTableRow[],
flakySummary: SummaryTableRow[],
checkInfos: CheckInfo[] = []
checkInfos: CheckInfo[] = [],
summaryText?: string
): Promise<void> {
// Add summary text if provided
if (summaryText) {
await core.summary.addRaw(summaryText).write()
Copy link

Copilot AI Oct 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The summary is being written immediately after adding the custom text, which will create separate summary sections. This should use addRaw(summaryText) without .write() to append to the summary, then write once at the end with all other content.

Suggested change
await core.summary.addRaw(summaryText).write()
core.summary.addRaw(summaryText)

Copilot uses AI. Check for mistakes.
}

if (table.length > 0) {
await core.summary.addTable(table).write()
}
Expand Down
3 changes: 2 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export async function run(): Promise<void> {
const checkRetries = core.getInput('check_retries') === 'true'
const annotateNotice = core.getInput('annotate_notice') === 'true'
const jobSummary = core.getInput('job_summary') === 'true'
const jobSummaryText = core.getInput('job_summary_text')
const detailedSummary = core.getInput('detailed_summary') === 'true'
const flakySummary = core.getInput('flaky_summary') === 'true'
const verboseSummary = core.getInput('verbose_summary') === 'true'
Expand Down Expand Up @@ -197,7 +198,7 @@ export async function run(): Promise<void> {
)
if (jobSummary && supportsJobSummary) {
try {
await attachSummary(table, detailTable, flakyTable, checkInfos)
await attachSummary(table, detailTable, flakyTable, checkInfos, jobSummaryText)
} catch (error) {
core.error(`❌ Failed to set the summary using the provided token. (${error})`)
}
Expand Down
Loading