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
- Host: GitHub
- URL: https://github.com/wpbonelli/schedule-outage
- Owner: wpbonelli
- License: unlicense
- Created: 2023-10-19T10:42:19.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-10-23T23:52:40.000Z (over 2 years ago)
- Last Synced: 2025-05-05T01:09:02.004Z (about 1 year ago)
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# schedule-outage
[](https://github.com/wpbonelli/schedule-outage/actions/workflows/test.yml)
[](https://www.repostatus.org/#wip)
[](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