roc/.github/actions/flaky-retry
Anton-4 d11a8e0a45
clean up retry output (#8367)
Signed-off-by: Anton-4 <17049058+Anton-4@users.noreply.github.com>
2025-11-10 18:59:35 +01:00
..
action.yml clean up retry output (#8367) 2025-11-10 18:59:35 +01:00
README.md added flaky retry action (#8258) 2025-09-30 14:00:57 +02:00

Flaky Retry Action

A GitHub Action that retries a command if it fails with a specific error string.

Inputs

  • command (required): The command to run
  • error_string_contains (required): Retry only if error output contains this string
  • retry_count (optional): Number of times to retry on failure (default: 3)

Usage

- name: Run flaky test
  uses: ./.github/actions/flaky-retry
  with:
    command: 'cargo test my_flaky_test'
    error_string_contains: 'connection timeout'
    retry_count: 5

Behavior

  • Runs the specified command
  • If the command succeeds (exit code 0), the action succeeds immediately
  • If the command fails (non-zero exit code):
    • Checks if the error output contains the specified string
    • If it does, retries up to retry_count times
    • If it doesn't, fails immediately without retrying
  • After all retries are exhausted, the action fails with the last exit code