【问题标题】:Trigger GitHub action on merge of Pull Request with specific tag在合并具有特定标签的拉取请求时触发 GitHub 操作
【发布时间】:2020-05-14 08:04:16
【问题描述】:

我正在尝试使用 GitHub 操作在合并带有标签 Update 的拉取请求时自动创建发布。

目前,我的工作流程在合并拉取请求时触发,但我不确定如何仅在拉取请求具有 Update 标记时使工作流程继续。

当前工作流程

name: Create Release

on:
  pull_request:
    types: [closed]

jobs:
  release:
    if: github.event.pull_request.merged == true

    ...rest of workflow...

【问题讨论】:

    标签: github pull-request github-actions


    【解决方案1】:

    您应该能够使用以下内容:

    if: contains(github.event.pull_request.labels.*.name, 'Update')
    

    来自https://help.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#example-using-an-array

    【讨论】:

      猜你喜欢
      • 2022-06-16
      • 2021-07-22
      • 1970-01-01
      • 2021-01-10
      • 2021-08-05
      • 2022-01-23
      • 2020-10-22
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多