Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/cheerz/poll_status

Github action for polling status with timeout
https://github.com/cheerz/poll_status

github-action kda kubernetes

Last synced: about 2 months ago
JSON representation

Github action for polling status with timeout

Awesome Lists containing this project

README

        

# Polling for status with a timeout

This action makes a GET request to a given URL until the status is `complete` or `failed`
Used after launching an action that executes asynchronously and polling for that action's status
Initially created for checking if a kubernetes deployment is complete

## Inputs

### `url`

The URL to poll

### `timeout`

Timeout before giving up in seconds

### `interval`

Interval between polling in seconds

## Example usage
```
uses: cheerz/poll_status@v1
with:
url: "https://www.example.com/deployments/1"
timeout: 20
interval: 5
```

This script expects a json response from the polling url in the following format:

```
{
status: "complete"/"failed"
}
```

Script exit with 1 when status is `failed` and 0 when `complete`
Exit with 1 if timeout reached before receiving `failed` or `complete` as status