【问题标题】:GitHub action - display the branch name to the build nameGitHub 操作 - 将分支名称显示为构建名称
【发布时间】:2021-06-02 19:07:12
【问题描述】:

我需要使用 gith hub 操作在每个手动构建中显示分支。 例如: https://gyazo.com/2131bf83b0df1e2157480e5be842d4fb

我应该显示分支,而不是 ONE。

【问题讨论】:

    标签: git github github-actions


    【解决方案1】:

    我进行了快速测试,不幸的是,无法在工作流名称中使用任何上下文或插值。 但是,您可以动态命名工作流中的作业:

    name: 'My workflow' # This name has to be hardcoded
    
    on: [workflow_dispatch]
    
    # or if you need inputs
    #
    # on:
    #  workflow_dispatch:
    #    inputs:
    #      myinput:
    #        description: 'What your input does'
    #        required: true
    
    jobs:
      myjob:
        name: ${{ github.ref }}
        runs-on: ubuntu-latest
        steps: [...]
    

    但它不会显示在您的 repo 的 Actions 页面中的运行列表中。

    【讨论】:

    猜你喜欢
    • 2021-01-05
    • 2021-10-12
    • 2020-06-03
    • 1970-01-01
    • 2016-12-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-01-12
    相关资源
    最近更新 更多