3

我创建了工作流程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!
4

1 回答 1

7

你需要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!
于 2021-05-13T17:50:13.490 回答