An open API service indexing awesome lists of open source software.

https://github.com/lexbritvin/wait-action

A GitHub Action that waits for jobs (matrix support + regex patterns), artifacts, or files to be ready with configurable timeout and polling intervals. Supports detached execution and flexible job matching patterns.
https://github.com/lexbritvin/wait-action

github-action job-matrix pattern-matching timeout wait

Last synced: 6 months ago
JSON representation

A GitHub Action that waits for jobs (matrix support + regex patterns), artifacts, or files to be ready with configurable timeout and polling intervals. Supports detached execution and flexible job matching patterns.

Awesome Lists containing this project

README

          

# โณ Wait for Job, Artifact, File Action

> ๐Ÿš€ Wait for jobs (matrix support + regex patterns), artifacts, or files with intelligent matching and configurable timeouts.

## โœจ Features

- ๐Ÿ“ **File Watching** - Wait for files to appear on disk
- ๐Ÿ“ฆ **Artifact Monitoring** - Track GitHub artifacts completion
- ๐Ÿ”„ **Job Synchronization** - Coordinate multiple workflow jobs with matrix support
- ๐ŸŽฏ **Smart Job Matching** - Flexible job name matching (exact, prefix, regex patterns)
- ๐Ÿ—๏ธ **Matrix Job Support** - Handle complex job matrices seamlessly
- ๐Ÿช„ **Regex Patterns** - Advanced pattern matching for dynamic job names
- โฐ **Smart Timeouts** - Configurable timeouts with polling
- ๐Ÿ“Š **Rich Feedback** - Detailed status messages with job completion details

## ๐Ÿš€ Quick Start

### ๐Ÿ”„ Wait for Jobs

```yaml
# ๐Ÿงช Wait for all test jobs
- name: โšก Wait for tests to complete
uses: lexbritvin/wait-action@v1
with:
condition-type: 'job'
job-name: 'test'
timeout-seconds: 900

# ๐Ÿ—๏ธ Wait with regex pattern
- name: ๐ŸŽจ Wait for build matrix
uses: lexbritvin/wait-action@v1
with:
condition-type: 'job'
job-name: '/build-\d+/'
timeout-seconds: 1200
```

### ๐Ÿ“ฆ Wait for Artifact

```yaml
- name: ๐ŸŽฏ Wait for test results
uses: lexbritvin/wait-action@v1
with:
condition-type: 'artifact'
artifact-name: 'test-coverage'
timeout-seconds: 600
```

### ๐Ÿ“ Wait for File

```yaml
- name: ๐Ÿ“„ Wait for build output
uses: lexbritvin/wait-action@v1
with:
condition-type: 'file'
file-path: './dist/bundle.js'
timeout-seconds: 300
```

## โš™๏ธ Configuration

| Input | Description | Required | Default | Example |
|-------------------------|-------------------------------------------|:--------:|---------|---------------------|
| `condition-type` | ๐ŸŽฏ **Type**: `file`, `artifact`, or `job` | Yes | - | `job` |
| `file-path` | ๐Ÿ“ File path to monitor | No | - | `./dist/app.js` |
| `artifact-name` | ๐Ÿ“ฆ Artifact to track | No | - | `build-assets` |
| `job-name` | ๐Ÿ”„ Job name or pattern | No | - | `test` or `/ci-.*/` |
| `timeout-seconds` | โฐ Max wait time in seconds | No | `1800` | `900` |
| `poll-interval-seconds` | ๐Ÿ”„ Check frequency | No | `10` | `5` |

## ๐ŸŽฏ Job Pattern Magic

| Pattern Type | Example | Matches |
|---------------|----------------|-----------------------------------------|
| ๐ŸŽฏ **Exact** | `deploy-prod` | Only "deploy-prod" |
| ๐Ÿ” **Prefix** | `test` | "test", "test (node-16)", "test-ubuntu" |
| ๐Ÿช„ **Regex** | `/test.*node/` | "test-with-node", "testing-node-16" |

### ๐ŸŒŸ Pattern Examples

```yaml
job-name: 'test' # ๐Ÿ” All test jobs
job-name: '/build-\d+/' # ๐Ÿ”ข build-1, build-42
job-name: '/^(ci|test)-/' # ๐ŸŽญ Jobs starting with ci- or test-
```

## ๐Ÿ“ค Outputs

- ๐ŸŽฏ **`result`**: `success` | `timeout` | `error`
- ๐Ÿ’ฌ **`message`**: Detailed status with job information

### ๐Ÿ“ Example Messages

```
โœ… All 3 job(s) completed: test (node-16), test (node-18), test (node-20)
โณ 2/3 job(s) still running: build (windows), build (macos)
โŒ No jobs found matching 'deploy'. Available: test, build, lint
```

## ๐Ÿ—๏ธ Real-World Example

```yaml
name: ๐Ÿš€ Smart Deploy Pipeline
on: [ push ]

jobs:
test:
name: Test Suite
runs-on: ubuntu-latest
strategy:
matrix:
node: [ 16, 18, 20 ]
os: [ ubuntu-latest, windows-latest ]
steps:
- run: npm test

build:
name: Build Assets
runs-on: ubuntu-latest
steps:
- run: npm run build

deploy:
name: ๐Ÿš€ Deploy to Production
runs-on: ubuntu-latest
steps:
- name: โณ Wait for all tests & builds
uses: lexbritvin/wait-action@v1
with:
condition-type: 'job'
job-name: '/(Test Suite|Build Assets)/'
timeout-seconds: 900

- name: ๐Ÿš€ Deploy application
run: echo "๐ŸŽ‰ Deploying to production!"
```

## ๐ŸŽจ Why Choose This Action?

- โœจ **Zero Configuration** - Works out of the box
- ๐Ÿ”ง **Highly Flexible** - Multiple condition types
- โšก **Performance Focused** - Efficient polling
- ๐Ÿ›ก๏ธ **Error Resilient** - Graceful timeout handling
- ๐Ÿ“Š **Rich Feedback** - Detailed status messages

## ๐Ÿ“„ License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

---

**โญ Star this repo if you find it useful!**

Made with โค๏ธ for the GitHub Actions community