无参数的Github动作输入

问题描述 投票:0回答:2

我有下面的github代码,它不需要输入参数,我只需要它能够在我想要的时候在github上执行操作。

但是github把我标记为警告,怎么办?

on:
  workflow_dispatch:
    inputs:

name: Build
jobs:
....
github yaml github-actions workflow building-github-actions
2个回答
0
投票

完全删除

inputs
行:

on:
  workflow_dispatch:

name: Build
...

请注意,分支名称仍将是一个输入参数,可在 GitHub UI 中选择。


0
投票

我只需要它能够在我想要的时候执行github上的动作。

这听起来像是一个手动触发器:Manually running a workflow.

on: workflow_dispatch

(参考:https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#workflow_dispatch

它显示其默认形式,没有像您拥有的

inputs
这样的其他元素。只需删除它们。

© www.soinside.com 2019 - 2024. All rights reserved.