A Go CLI tool for testing GitHub Actions pipeline resilience and retry logic. BritishInput helps validate pipeline configurations by providing deterministic and random exit status behaviors.
BritishInput was created to help test GitHub Actions pipeline retry mechanisms and failure handling. When running long pipelines, transient failures often occur that can be resolved by retrying. This tool helps validate that your pipeline configuration correctly handles such scenarios by:
- Providing predictable success/failure exit statuses
- Simulating random failures with 50/50 probability
- Enabling testing of retry logic and failure cascades
# Clone the repository
git clone https://github.com/gkwa/britishinput.git
# Build the binary
cd britishinput
go buildBritishInput provides three modes of operation:
- Default mode (50/50 chance of success/failure):
./britishinput- Always fail:
./britishinput fail- Always succeed:
./britishinput passExample usage with exit status checking:
$ ./britishinput; echo $?
0 # or 1 (random)
$ ./britishinput fail; echo $?
1 # always fails
$ ./britishinput pass; echo $?
0 # always succeedsBritishInput is particularly useful for testing GitHub Actions pipeline configurations. Here's an example workflow that demonstrates retry logic:
jobs:
test-retry:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: ">=1.21"
- name: Build
run: go build -v
- name: Run with potential failure
run: ./britishinputThe tool can help validate:
- Retry mechanisms
- Failure cascades
- Pipeline recovery logic
- Complex conditional job execution
- Deterministic success/failure modes
- Random 50/50 success probability
- Simple CLI interface
- Configurable via environment variables and config file
- JSON logging support
- Verbose mode for debugging
View the current version:
./britishinput version