CICD-006 · Select a manual target
Encyclopedia · Events and triggers · All snippets
Previous · CICD-005 · Next · CICD-007
1. Where it fits
- Placement .github/workflows/ci.yml, at workflow level, or within jobs for a named job mapping.
- Prerequisites workflow on an example repository with main as default.
- Platforms github-actions, gitea-actions.
2. Copy the snippet
yaml
on:
workflow_dispatch:
inputs:
target:
type: choice
options: [lab, staging]
required: true3. How it works
The choice lists allowed values for the operator. Read inputs.target as a string and connect it to a job condition or command value explicitly.
4. Verify the result
Read inputs.target in a job and test both values. Check Gitea support for typed choices.
Watch for. Place event filters at workflow scope and test an event that should run and an event that should be skipped.
Validation syntax-validated (YAML parse). Status definitions.