Skip to content

CICD-216 · Workflow dispatch through REST API ​

Encyclopedia · Advanced workflow orchestration · All snippets

Previous · CICD-215 · Next · CICD-217

1. Where it fits ​

  • Placement CI run step or authorized lab terminal.
  • Prerequisites authenticated GitHub CLI, approved target repositories, or Actions runner for YAML entries.
  • Platforms github-actions, github-cli.
  • Parameters TARGET_REPO, WORKFLOW.

2. Copy the snippet ​

bash
gh workflow run "${WORKFLOW:?}" --repo "${TARGET_REPO:?}" --ref main -f target=staging

3. How it works ​

The CLI requests a manual run for the specified repository, workflow, ref and inputs. Inspect the downstream run for actual execution. The command archives or inspects the selected files. Verify the relative paths and file set before using the archive downstream.

4. Verify the result ​

Use a workflow_dispatch input named target and verify a new run appears for main.

Validation syntax-validated (Bash parse). Status definitions.