core.summary.write() fails to display summary when running in a container
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 5.9k
- Forks
- 1.8k
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
Despite calling await core.summary.write(), the Step Summary is not being generated or displayed in the GitHub Actions UI. Even though the logs indicate the script has finished successfully, the summary remains empty.
To Reproduce
jobs:
tests:
runs-on: self-hosted
container:
image: ubuntu
steps:
- uses: actions/checkout@v4
- uses: actions/github-script@v7
with:
script: |
const script = require('./scripts/sample.js')
await script({github, context, core})
console.log('completed all jobs.')
// sample.js
module.exports = async ({github, context, core}) => {
let rowsA = ['a', 'b', 'c']
core.summary.addRaw(`## RowsA`).addEOL()
for (const row of rowsA) {
core.summary.addRaw(`### ${row}`, true).addEOL()
}
console.log('rowsA add raw')
let rowsB = ['d', 'e', 'f']
core.summary.addRaw(`## RowsB`).addEOL()
for (const row of rowsB) {
core.summary.addRaw(`### ${row}`, true).addEOL()
}
console.log('rowsB add raw')
console.log("Summary content before write:", core.summary.stringify());
await core.summary.write({overwrite: true})
console.log("Summary content after write:", core.summary.stringify());
console.log('process is completed.')
}
Expected behavior
The content is written at summary.
Additional context
The logs show "process is completed," confirming that await core.summary.write() was reached and executed without throwing any errors. However, the summary tab in the GitHub UI does not appear or shows no content.
After await core.summary.write({overwrite: true}), wait about 20 seconds and it will be written.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the provided GitHub Actions workflow with sample.js in the ubuntu container and compare when the Step Summary appears. Trace the implementation behind core.summary.write(), focusing on the container-specific behavior described in the report. Done means the summary is reliably generated and displayed, or the expected delay is clearly documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github-actions, typescript
- Domain
- ci-cd, devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100