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.
- Host: GitHub
- URL: https://github.com/lexbritvin/wait-action
- Owner: lexbritvin
- License: mit
- Created: 2025-06-02T23:25:10.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-06-23T15:47:25.000Z (10 months ago)
- Last Synced: 2025-06-23T16:25:59.223Z (10 months ago)
- Topics: github-action, job-matrix, pattern-matching, timeout, wait
- Language: JavaScript
- Homepage:
- Size: 301 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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