'Dynamic Github Actions Steps

The following shows what the Github Actions tab displays for a typical build:

output

The Build step actually has a number of sub-steps, but I do not want to use Github Actions as a scripting language just to be able to have each sub-step discreetly displayed. Is there any sort of magic that Github Actions provides to signal that you wish the visualization of the build to show a discrete step (i.e. a "dynamic step")?

I'm hoping for something like the following which would cause the creation of discrete result nodes in the output of the Github Actions build visualization:

- name: Dynamic Steps
  run |
     echo "###github-action-step: Step 1"
     echo "###github-action-step: Step 2"
     echo "###github-action-step: Step 3"



Solution 1:[1]

Something close to that can be achieved by skipping steps and/or dynamically setting the steps name.

i.e. I'm using like this to customize the tab message on GH actions:

      - name: "Pulling existing Docker image ${{ github.event.repository.name }}:${{ steps.variables.outputs.commitSha }}"
        if: steps.image_checker.outputs.shouldBuildNewImage == 0
        run: |
          docker pull ${{ steps.variables.outputs.dockerRepositoryUrl }}:${{ steps.variables.outputs.commitSha }}

When the step is skipped, it still appears in the logs, but grayed out and in my scenario, the text doesn't show the 'image:tag' getting pulled

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 R44