Skip to content

Commit c130b82

Browse files
committed
reword
1 parent f5bea27 commit c130b82

File tree

4 files changed

+38
-27
lines changed

4 files changed

+38
-27
lines changed

__tests__/github/core.test.ts

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,11 @@ describe('addReportFooters', () => {
151151
addReportFooters(report, inputs, true)
152152

153153
expect(mockCore.summary.addRaw).toHaveBeenCalledWith(
154-
expect.stringContaining('Comparison with baseline:')
154+
expect.stringContaining('Comparison with')
155155
)
156156
expect(mockCore.summary.addRaw).toHaveBeenCalledWith(
157157
expect.stringContaining(
158-
'[abcdef1](https://github.com/test-owner/test-repo/commit/abcdef1234567890)'
158+
'by [abcdef1](https://github.com/test-owner/test-repo/commit/abcdef1234567890)'
159159
)
160160
)
161161
})
@@ -201,7 +201,7 @@ describe('addReportFooters', () => {
201201
addReportFooters(report, inputs, true)
202202

203203
expect(mockCore.summary.addRaw).toHaveBeenCalledWith(
204-
expect.stringContaining('Comparison with baseline:')
204+
expect.stringContaining('Comparison with')
205205
)
206206
})
207207

@@ -392,7 +392,12 @@ describe('addReportFooters', () => {
392392
addReportFooters(report, inputs, true)
393393

394394
expect(mockCore.summary.addRaw).toHaveBeenCalledWith(
395-
expect.stringContaining('[#42](https://ci.example.com/builds/42)')
395+
expect.stringContaining('run [#42](https://ci.example.com/builds/42)')
396+
)
397+
expect(mockCore.summary.addRaw).toHaveBeenCalledWith(
398+
expect.stringContaining(
399+
'by [abcdef1](https://github.com/test-owner/test-repo/commit/abcdef1234567890)'
400+
)
396401
)
397402
})
398403

@@ -439,10 +444,12 @@ describe('addReportFooters', () => {
439444
addReportFooters(report, inputs, true)
440445

441446
expect(mockCore.summary.addRaw).toHaveBeenCalledWith(
442-
expect.stringContaining('#42')
447+
expect.stringContaining('run #42')
443448
)
444-
expect(mockCore.summary.addRaw).not.toHaveBeenCalledWith(
445-
expect.stringContaining('[#42]')
449+
expect(mockCore.summary.addRaw).toHaveBeenCalledWith(
450+
expect.stringContaining(
451+
'by [abcdef1](https://github.com/test-owner/test-repo/commit/abcdef1234567890)'
452+
)
446453
)
447454
})
448455

@@ -491,7 +498,7 @@ describe('addReportFooters', () => {
491498

492499
// Should only contain commit, not build info (since buildNumber is required)
493500
expect(mockCore.summary.addRaw).toHaveBeenCalledWith(
494-
expect.stringContaining('Comparison with baseline:')
501+
expect.stringContaining('Comparison with')
495502
)
496503
})
497504

@@ -540,7 +547,12 @@ describe('addReportFooters', () => {
540547
addReportFooters(report, inputs, true)
541548

542549
expect(mockCore.summary.addRaw).toHaveBeenCalledWith(
543-
expect.stringContaining('#99')
550+
expect.stringContaining('run [#99](https://ci.example.com/builds/99)')
551+
)
552+
expect(mockCore.summary.addRaw).toHaveBeenCalledWith(
553+
expect.stringContaining(
554+
'by [abcdef1](https://github.com/test-owner/test-repo/commit/abcdef1234567890)'
555+
)
544556
)
545557
expect(mockCore.summary.addRaw).not.toHaveBeenCalledWith(
546558
expect.stringContaining('old-build')

dist/index.js

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/github/core.ts

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -145,21 +145,20 @@ export function addReportFooters(
145145
const footerMessages: string[] = []
146146

147147
if (report.baseline && hasPreviousResultsReports) {
148-
let comparisonText = `Comparison with baseline: `
149-
if (report.baseline.commit) {
150-
const commitSha = report.baseline.commit.substring(0, 7)
151-
const commitUrl = `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/commit/${report.baseline.commit}`
152-
comparisonText += `[${commitSha}](${commitUrl})`
153-
}
154-
148+
let comparisonText = `Comparison with `
155149
if (report.baseline.buildNumber || report.baseline.buildName) {
156150
const buildDisplay = report.baseline.buildNumber
157151
if (report.baseline.buildUrl) {
158-
comparisonText += ` | [#${buildDisplay}](${report.baseline.buildUrl})`
152+
comparisonText += `run [#${buildDisplay}](${report.baseline.buildUrl})`
159153
} else {
160-
comparisonText += ` | #${buildDisplay}`
154+
comparisonText += `run #${buildDisplay}`
161155
}
162156
}
157+
if (report.baseline.commit) {
158+
const commitSha = report.baseline.commit.substring(0, 7)
159+
const commitUrl = `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/commit/${report.baseline.commit}`
160+
comparisonText += ` by [${commitSha}](${commitUrl})`
161+
}
163162

164163
footerMessages.push(comparisonText)
165164
}

0 commit comments

Comments
 (0)