从另一个工作流程触发新的工作流程? [英] Triggering a new workflow from another workflow?
问题描述
我可以从另一个工作流程中触发一个新的工作流程吗?
Can I trigger a new workflow from another workflow?
在第一个工作流程推送了一个新版本之后,我正在尝试运行一个工作流程,但似乎忽略了它.
I'm trying to run a workflow after the first workflow has pushed a new release and it seems to ignore it.
推荐答案
找到了答案此处:
工作流程运行中的操作无法触发新的工作流程运行.例如,如果某个操作使用存储库的GITHUB_TOKEN推送代码,则即使存储库包含配置为在发生推送事件时运行的工作流,新的工作流也不会运行.
An action in a workflow run can't trigger a new workflow run. For example, if an action pushes code using the repository's GITHUB_TOKEN, a new workflow will not run even when the repository contains a workflow configured to run when push events occur.
The quote above might be confusing. When I add a Personal Access Token (PAT) to the checkout action with repo
permissions granted (and not repository's GITHUB_TOKEN), the following commands DO trigger other workflows:
- name: Checkout Repo
uses: actions/checkout@v2
with:
token: ${{ secrets.PAT_TOKEN }}
(在我的情况下,在此签出后运行semnatic-release,这会创建带有新标签的新版本-确实触发了另一个仅在创建标签后才运行的工作流程)
(In my case, running semnatic-release after this checkout, which creates a new release with a new tag - did trigger another workflow that runs only if a tag was created)
这篇关于从另一个工作流程触发新的工作流程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!