gpt4 book ai didi

github - 您可以将 `enum` 与 GitHub Action 的 `action.yml` 中的输入和工作流文件一起使用吗?

转载 作者:行者123 更新时间:2023-12-02 16:06:46 25 4
gpt4 key购买 nike

我有一个 GitHub 操作(在 .github/actions/my-custom-action 中),它接受一个枚举输入。在 action.yml 中:

inputs:
my-enum-input:
description: "This is an input that's an enum"
default: "all"
required: true

INPUT_MY_ENUM_INPUT 的类型如 ['all', 'a', 'b'] 已在 操作调用的脚本文件中检查。 yml 文件。有没有办法强制将 action.yml 文件中的枚举作为输入,并检查调用操作的 Worksheet YAML 文件以确保其有效?

最佳答案

看起来像a lot of people wanted this featurethe GitHub team added it .我在他们的文档中找不到它,但它记录在 their blog post announcing the feature 中.如果声明类型为 choice 的输入变量 name,则可以限制输入 options 的列表,如下所示:

inputs:
name:
type: choice
description: Who to greet
options:
- monalisa
- cschleiden

关于github - 您可以将 `enum` 与 GitHub Action 的 `action.yml` 中的输入和工作流文件一起使用吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69239179/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com