【问题标题】:Is there any way to trigger a specific Github action workflow by commit message value?有没有办法通过提交消息值触发特定的 Github 操作工作流?
【发布时间】:2022-01-19 10:44:57
【问题描述】:

有没有办法通过 commit-message 值触发特定的 Github 操作工作流?例如,如果我使用提交消息“smoke_test”推送,则只有(一个特定的工作流程)冒烟测试工作流程应该从一组工作流程中触发。请帮忙,谢谢!

【问题讨论】:

    标签: triggers workflow github-actions commit


    【解决方案1】:

    是的,有。如果提交消息包含特定关键字,您可以检查触发事件。

    这是一个例子:

    name: Smoke tests
    on: push
    
    jobs:
     test:
       runs-on: [ ubuntu-latest ]
       steps:
         - name: Run smoke tests
           if: contains(github.event.head_commit.message, 'smoke_test')
           run: |
             echo 'Running smoke tests!'
    

    【讨论】:

      猜你喜欢
      • 2021-09-15
      • 2019-09-03
      • 1970-01-01
      • 1970-01-01
      • 2022-12-18
      • 1970-01-01
      • 2020-09-29
      • 2021-09-10
      • 1970-01-01
      相关资源
      最近更新 更多