Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to show message in the actions tab in github actions workflow

I have a requirement where I need to print information in the actions tab when the workflow runs is there a way to do that? enter image description here

like image 663
Swathi DA Avatar asked Nov 18 '25 11:11

Swathi DA


1 Answers

Yes, this can be done by writing a Job Summary in your workflow:

Workflow with a job summary

The simplest way to do that is to append any valid markdown content to the file referenced by the $GITHUB_STEP_SUMMARY environment variable.

echo "### Hello world! :rocket:" >> $GITHUB_STEP_SUMMARY

You can do the same thing from PowerShell:

"### Hello world! :rocket:" >> $env:GITHUB_STEP_SUMMARY

Or using the actions/github-script action:

- uses: actions/github-script@v6
  id: my-script
  with:
    result-encoding: string
    retries: 3
    retry-exempt-status-codes: 400,401
    script: |
      core.summary
         .addHeading('Test Results')
         .addCodeBlock(generateTestResults(), "js")
         .addTable([
           [{data: 'File', header: true}, {data: 'Result', header: true}],
           ['foo.js', 'Pass ✅'],
           ['bar.js', 'Fail ❌'],
           ['test.js', 'Pass ✅']
         ])
         .addLink('View staging deployment!', 'https://github.com')
         .write()

To attach something like:

Job summary showing fancy tabled results

like image 136
jessehouwing Avatar answered Nov 20 '25 06:11

jessehouwing



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!