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?

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

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:

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