Do Github Actions provide a way to append values to job names, display workflow summary, or write values anywhere on summary view?
My goal is to have quick glance at results and avoid opening jobs to view the values in echo steps or raw logs.
Please see the example below where I demonstrated values that I already have available in my workflow outputs:
The closest solution I could find is Adding a Job Summary section to the workflow run view. Summary content is generated at run and can show values produced by the workflow which is exactly what I wanted.
Workflow step
# Set Job Summary
- name: Set Job Summary
run: |
echo "### ${{inputs.environment}} tested! " >> $GITHUB_STEP_SUMMARY
Result (notice how it appeared below all other sections)
Here's a detailed example from github.blog, only down side of this approach is that the summary section is appended to the bottom of the page, and will apear below error and warning blocks thus you will need to scroll down to view the custom summary.
I wanted the same thing, did it with a workaround.
I noticed that the azure-deploy
job was somehow setting a URL that was shown in the Summary:
I was able to generate a dummy URL for steps with the data I needed. Tradeoff is that it looks like a URL.
Sample code to be added to the github action yaml
file:
jobs:
build: # I wanted it for the build job
environment:
name: 'Production'
# Modify URL to whatever data you want to show, should be a valid URL
url: ${{ steps.zip-size.outputs.size }}
...
...
steps:
- name: Get size of the final release.zip
id: zip-size
run: echo "size=https://dvsj.in?size=$(du -sh release.zip | cut -f1)" >> $GITHUB_OUTPUT
So the final output looks like this:
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