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

https://github.com/wpbonelli/schedule-outage

Disable an action or workflow randomly or periodically
https://github.com/wpbonelli/schedule-outage

Last synced: 5 months ago
JSON representation

Disable an action or workflow randomly or periodically

Awesome Lists containing this project

README

          

# schedule-outage

[![Test](https://github.com/wpbonelli/schedule-outage/actions/workflows/test.yml/badge.svg)](https://github.com/wpbonelli/schedule-outage/actions/workflows/test.yml)
[![Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public.](https://www.repostatus.org/badges/latest/wip.svg)](https://www.repostatus.org/#wip)
[![GitHub tag](https://img.shields.io/github/tag/wpbonelli/schedule-outage.svg)](https://github.com/wpbonelli/schedule-outage/tags/latest)

Disable an action or workflow randomly or periodically.

Useful e.g. to signal deprecation, or (if your action calls a service you control) for maintenance windows.

- [Usage](#usage)
- [Inputs](#inputs)
- [Notes](#notes)

## Usage

```yml
# warn that an action will be archived and suggest migration
- uses: wpbonelli/schedule-outage@v1
with:
probability: 0.1
message: 'this/action retires soon, use something/else@v1'

# disable actions clients during a weekly maintenance window
# note: no guarantees that your service will not be invoked!
# somebody could just fork your action and remove this step.
- uses: wpbonelli/schedule-outage@v1
with:
schedule: '0 0 * * 0'
duration: 1
message: 'Down for maintenance, back in 1 hour'
```

## Inputs

| Name | Description | Required | Default |
| --- | --- | --- | --- |
| `schedule` | Cron expression for periodic outages | No | - |
| `duration` | Duration of scheduled outage (hours) | No | 1 (if `schedule` provided) |
| `probability` | Probability of outage | No | - |
| `message` | Message to display | No | 'Action or workflow disabled' |

## Notes

* either `schedule` or `probability` must be provided

* if `probability` is provided without `schedule`, the outage occurs probabilistically at every run

* `schedule` and `probability` can be used together — if both are provided, an outage occurs probabilistically at the scheduled times

* if `duration` is provided without `schedule`, it will be ignored

* if `schedule` is provided, [`croniter`](https://github.com/kiorky/croniter) is used to parse the cron expression — if pip install fails, the action aborts without failing the workflow