【问题标题】:Workflow is not shown so I cannot run it manually (Github Actions)未显示工作流程,因此我无法手动运行它(Github Actions)
【发布时间】:2021-08-04 00:16:46
【问题描述】:
我创建了工作流Test,但没有Run workflow 按钮可以手动运行它。
这是我的test.yml 文件。有什么遗漏吗?
name: Test
on:
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run a one-line script
run: echo Hello, world!
【问题讨论】:
标签:
github
yaml
workflow
github-actions
cicd
【解决方案1】:
你需要把workflow_dispatch:放在on:下面。
name: Test
on:
release:
types: [created]
workflow_dispatch: # Put here!!
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run a one-line script
run: echo Hello, world!
然后,会显示一个Run workflow 按钮。
可以将workflow_dispatch: 放在release: 之前。它也可以。
name: Test
on:
workflow_dispatch: # Putting here is also fine!!
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run a one-line script
run: echo Hello, world!