mirror of
https://github.com/gradle/actions
synced 2024-12-17 21:52:21 +00:00
parent
12646f8198
commit
cc54166e15
2 changed files with 11 additions and 2 deletions
1
.github/workflows/demo-job-summary.yml
vendored
1
.github/workflows/demo-job-summary.yml
vendored
|
@ -35,6 +35,7 @@ jobs:
|
|||
run: |
|
||||
./gradlew tasks --no-daemon
|
||||
./gradlew help check
|
||||
./gradlew wrapper --gradle-version 8.7 --gradle-distribution-sha256-sum 544c35d6bd849ae8a5ed0bcea39ba677dc40f49df7d1835561582da2009b961d
|
||||
- name: Fail groovy-dsl project
|
||||
working-directory: .github/workflow-samples/groovy-dsl
|
||||
continue-on-error: true
|
||||
|
|
|
@ -96,8 +96,8 @@ function renderSummaryTable(results: BuildResult[]): string {
|
|||
function renderBuildResultRow(result: BuildResult): string {
|
||||
return `
|
||||
<tr>
|
||||
<td>${result.rootProjectName}</td>
|
||||
<td>${result.requestedTasks}</td>
|
||||
<td>${truncateString(result.rootProjectName, 30)}</td>
|
||||
<td>${truncateString(result.requestedTasks, 60)}</td>
|
||||
<td align='center'>${result.gradleVersion}</td>
|
||||
<td align='center'>${renderOutcome(result)}</td>
|
||||
<td>${renderBuildScan(result)}</td>
|
||||
|
@ -157,3 +157,11 @@ function shouldAddJobSummary(option: params.JobSummaryOption, buildResults: Buil
|
|||
return buildResults.some(result => result.buildFailed)
|
||||
}
|
||||
}
|
||||
|
||||
function truncateString(str: string, maxLength: number): string {
|
||||
if (str.length > maxLength) {
|
||||
return `<div title='${str}'>${str.slice(0, maxLength - 1)}…</div>`
|
||||
} else {
|
||||
return str
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue