Skip to content

CICD-227 · Workflow rerun automation ​

Encyclopedia · Advanced workflow orchestration · All snippets

Previous · CICD-226 · Next · CICD-228

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 RUN_ID, TARGET_REPO.

2. Copy the snippet ​

bash
gh run rerun "${RUN_ID:?}" --repo "${TARGET_REPO:?}" --failed

3. How it works ​

The CLI targets a specific workflow run and reads or changes its run state. Check the run ID and attempt at the selected repository.

4. Verify the result ​

Use a completed run that contains failed jobs. Check that a new attempt appears under the original run ID.

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