动态 Github 操作步骤

Der*_*eer 7 github-actions

下面显示了典型构建的 Github Actions 选项卡显示的内容:

输出

构建步骤实际上有许多子步骤,但我不想使用 Github Actions 作为脚本语言,只是为了能够谨慎地显示每个子步骤。Github Actions 是否提供了某种魔力来表明您希望构建的可视化显示离散步骤(即“动态步骤”)?

我希望出现类似以下内容的内容,这会导致在 Github Actions 构建可视化的输出中创建离散结果节点:

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

Run Code Online (Sandbox Code Playgroud)

R44*_*R44 3

通过跳过步骤和/或动态设置步骤名称可以实现接近的效果。

即我使用这样来自定义 GH 操作的选项卡消息:

      - 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 }}

Run Code Online (Sandbox Code Playgroud)

当跳过该步骤时,它仍然出现在日志中,但呈灰色,在我的场景中,文本不会显示“image:tag”被拉出