GitHub Action
Random Wait Action
This is a very simple github action that lets you wait for a random amount of time in seconds. This is useful for workflows that have a lot of parallel jobs and you want to avoid them all hitting the same API at the same time.
I ran into this when I was trying to use the excellent schneegans/dynamic-badges-action to generate a badge for my github action. I wanted to use the action to generate a badge that showed the status of the across a matrix of twelve jobs. However, I kept running into 500 errors from the API. I realized that the API was probably rate limiting me because I was hitting it with twelve requests at the same time. I decided to use this action to add a random delay to each job so that they would hit the API at different times.
name | type | default | required |
---|---|---|---|
minimum | integer | 1 | no |
maximum | integer | 10 | no |
name | type | description |
---|---|---|
wait_time | integer | The amount of time in seconds that the action waited |
name: Random Wait
uses: AliSajid/random-wait-action@v1
with:
minimum: 1
maximum: 10
This project is licensed under the MIT License - see the LICENSE file for details