| 声明 | on: workflow_dispatch.inputs |
|---|---|
| 类型 | string、boolean、choice、environment |
| 入口 | 界面、REST API、gh CLI |
| 权限 | 由仓库权限控制 |
带选项的手动发布
带选项的手动发布
on:
workflow_dispatch:
inputs:
env:
type: choice
options: [staging, production]
default: staging
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- run: echo "deploy to ${{ inputs.env }}"
# CLI:gh workflow run deploy.yml -f env=staging手动入口配合环境保护规则:默认值与审批配置共同约束误操作。