Skip to content
Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PollyAction

A free, MIT-licensed retry/backoff wrapper for any GitHub Actions step.

Flaky network calls, rate-limited package registries, transient cloud API errors — CI jobs fail for reasons that have nothing to do with your code. PollyAction wraps any shell command with configurable exponential-backoff retries, so a blip doesn't fail your whole pipeline.

Named after (and built by the same author as) the Polly-inspired Swevo Polly* package family — 28+ free, MIT-licensed .NET resilience packages. Same philosophy, brought to your CI pipeline instead of your app code.

Why

Commercial CI platforms bundle "retry step" as a paid or Enterprise-only feature. Some marketplace actions charge, or bury retry behind bloated all-in-one toolkits. PollyAction does one thing — retry a command with exponential backoff — for free, with no telemetry, no lock-in, no account.

Usage

- name: Restore packages (with retry)
  uses: Swevo/PollyAction@v1
  with:
    command: dotnet restore
    max-attempts: 5
    backoff-seconds: 2
    backoff-multiplier: 2

That's it. dotnet restore will be retried up to 5 times, waiting 2s, then 4s, then 8s, then 16s between attempts (exponential backoff), before the step is marked as failed.

Full example

- name: Push to NuGet (with retry)
  uses: Swevo/PollyAction@v1
  with:
    command: dotnet nuget push *.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
    max-attempts: 4
    backoff-seconds: 3
    backoff-multiplier: 2
    max-backoff-seconds: 30
    timeout-minutes: 2
    shell: bash
    working-directory: ./nupkgs

Inputs

Input Default Description
command (required) The shell command to run and retry on failure.
max-attempts 3 Maximum number of attempts before giving up.
backoff-seconds 2 Initial delay (seconds) before the first retry.
backoff-multiplier 2 Multiplier applied to the delay after each failed attempt.
max-backoff-seconds 60 Upper bound on the delay between retries.
timeout-minutes 0 (no timeout) Per-attempt timeout. An attempt that exceeds this is treated as a failure and retried.
shell bash Shell to run the command in: bash, sh, pwsh, or cmd.
working-directory . Working directory for the command.

Outputs

Output Description
attempts Number of attempts actually made.
succeeded "true" if the command eventually succeeded, "false" otherwise.

How it works

PollyAction runs your command in the chosen shell. On non-zero exit, it waits backoff-seconds, then retries, doubling (or multiplying by backoff-multiplier) the wait each time up to max-backoff-seconds, until max-attempts is reached or the command succeeds.

License

MIT — see LICENSE.

Also by the same author

Free, MIT-licensed alternatives to commercial dev tools:

Package Alternative to Description
FluentPdf IronPDF, Aspose.PDF Fluent PDF generation for .NET
AutoBus MassTransit (paid tiers) Lightweight in-process/distributed message bus
AutoArchitecture NetArchTest, ArchUnitNET Roslyn analyzers enforcing architecture rules
EFCore.BulkOperations EFCore.BulkExtensions (commercial features) Bulk insert/update/delete for EF Core
AutoAssert FluentAssertions (commercial license) Fluent, MIT-licensed test assertions
PollyAnalyzers ReSharper resilience inspections Roslyn analyzers for async/resilience anti-patterns

See github.com/Swevo for the full catalog (60+ packages).

About

Retry any CI step with exponential backoff. Free, zero-config, MIT licensed.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages