From 631e7f0d8804b3eba9753fab537f4f61abcb314f Mon Sep 17 00:00:00 2001 From: NianBroken Date: Tue, 7 May 2024 13:42:43 +0800 Subject: [PATCH] Added GitHub Actions workflow for clearing JSdelivr cache --- .github/workflows/main.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9633654..b0a69e4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -131,8 +131,9 @@ jobs: git commit -m "Update from GitHub Actions" || true git push origin main --force - - name: Purge images + - name: Purge JSdelivr Cache run: | for i in {1..50}; do - curl -X PURGE "https://purge.jsdelivr.net/gh/NianBroken/ZFCheckScores/img/$i.png" + response=$(curl -X POST -H "Content-Type: application/json" -d '{}' "https://purge.jsdelivr.net/gh/NianBroken/ZFCheckScores/img/$i.png") + echo $response done \ No newline at end of file