Skip to content

CICD-011 · React to a completed workflow ​

Encyclopedia · Events and triggers · All snippets

Previous · CICD-010 · Next · CICD-012

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_run:
    workflows: ["Build and test"]
    types: [completed]

3. How it works ​

workflow_run fires when the named workflow changes to completed. Consumers need an explicit conclusion check and should verify any artifact accepted into a privileged context.

4. Verify the result ​

GitHub runs this on failure too. Filter by conclusion at job scope before privileged operations.

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.