Skip to content

Commit ba13814

Browse files
committed
Simplify the trigger job summary
Drop the heading and the "override" wording - just one plain line per build. Use core.summary.addRaw per-line (with EOL) instead of joining with a single newline, since raw markdown lines need an explicit EOL between them to render as separate lines rather than one squashed paragraph. Shows the actual derived environment (mirroring resolve-env's own logic) rather than an often-blank override value.
1 parent 6eaf147 commit ba13814

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

.github/workflows/docs-trigger-builds.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,11 @@ jobs:
105105
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
106106
env:
107107
BUILDS: ${{ needs.prepare-ref-env.outputs.builds }}
108+
PROD_BRANCH: ${{ env.PROD_BRANCH }}
108109
with:
109110
script: |
110111
const builds = JSON.parse(process.env.BUILDS)
111-
const lines = []
112+
const prodBranch = process.env.PROD_BRANCH
112113
for (const build of builds) {
113114
await github.rest.actions.createWorkflowDispatch({
114115
owner: context.repo.owner,
@@ -130,11 +131,11 @@ jobs:
130131
'publish-env': build.publishEnv,
131132
},
132133
})
133-
const envNote = build.publishEnv ? ` (publish-env override: \`${build.publishEnv}\`)` : ''
134-
lines.push(`- \`docs-generate-html.yml\` for build-ref \`${build.buildRef}\`${envNote}`)
134+
// Mirrors resolve-env's own derivation for display purposes only - the
135+
// real derivation happens inside the dispatched run, this is just to show
136+
// what it will resolve to when no explicit override was passed.
137+
const env = build.publishEnv || (build.buildRef === prodBranch ? 'prod' : 'dev')
138+
core.summary.addRaw(`Triggered \`docs-generate-html.yml\` on branch \`${build.buildRef}\` for \`${env}\``, true)
135139
}
136140
137-
await core.summary
138-
.addHeading('Triggered builds')
139-
.addRaw(lines.join('\n'))
140-
.write()
141+
await core.summary.write()

0 commit comments

Comments
 (0)