Skip to content

Commit

Permalink
Merge pull request shipwright-io#1386 from qu1queee/qu1queee/deletion…
Browse files Browse the repository at this point in the history
…-assets

Ensure assets deletion use a sleep time
  • Loading branch information
openshift-merge-robot authored Sep 21, 2023
2 parents dfd25b6 + c17d1fd commit 7efcfbe
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
Expand Up @@ -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
Expand Down

0 comments on commit 7efcfbe

Please sign in to comment.