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@v2
name: Add Random Waiting Time
uses: AliSajid/random-wait-action@f9109712daa7a8103f7be16b68634b9d376587a7 # v2.4.1
with:
minimum: 1
maximum: 10
This original source code of this project is licensed under the MIT License. Other non-essential files are licensed under the CC0 Public Domain Dedication and the author(s) dedicate them to the public domain.