Skip to content

Commit

Permalink
Ensure assets deletion use a sleep time
Browse files Browse the repository at this point in the history
Recommended by github when hitting the secondary rate limits
qu1queee committed Sep 20, 2023
1 parent ed489b6 commit c17d1fd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/cleanup-nightly-assets.yaml
Original file line number Diff line number Diff line change
@@ -36,8 +36,13 @@ jobs:
exit 0
fi
echo "[INFO] Going to delete ${ASSETS_TO_REMOVE} assets"
find $WORK_DIR -type f -iname "*.yaml" -printf "%f\n" | grep -v "${{ steps.currentmonth.outputs.date }}\|${{ steps.previousmonth.outputs.date }}" |
while IFS= read FILE; do
# sleep 2 sec, as recommended by https://docs.github.com/en/rest/guides/best-practices-for-using-the-rest-api?apiVersion=2022-11-28#dealing-with-secondary-rate-limits
sleep 2
echo "[INFO] Going to delete ${FILE} asset"
gh release delete-asset nightly $FILE -y
done

0 comments on commit c17d1fd

Please sign in to comment.