Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to display custom/dynamic info on the Github Workflow Summary view?

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:

enter image description here

like image 681
Cortex Avatar asked Oct 13 '25 05:10

Cortex


2 Answers

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) enter image description here

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.

like image 96
Cortex Avatar answered Oct 15 '25 15:10

Cortex


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:
azure-deploy job


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:
enter image description here

like image 44
Bojan Krkic Avatar answered Oct 15 '25 14:10

Bojan Krkic