Skip to content

Commit fef525e

Browse files
committed
workflow: update clear_cache
1 parent ab74bb6 commit fef525e

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

.github/workflows/clear_cache.yml

+13-8
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
name: Clean jsDelivr Cache
22

33
on:
4-
# push
5-
# https://github.com/qinxs/cdn-assets
64
push:
75
branches:
86
- master
@@ -18,19 +16,26 @@ jobs:
1816
runs-on: ubuntu-latest
1917

2018
steps:
19+
- name: Apt Update
20+
env:
21+
DEBIAN_FRONTEND: noninteractive
22+
run: |
23+
sudo apt-get update
24+
sudo apt-get -y install jq
25+
2126
- uses: actions/checkout@v4
2227

2328
# https://github.com/marketplace/actions/git-changesets
2429
- id: changed_files
2530
name: git-changesets
26-
uses: collin-miller/git-changesets@v0.0.4
31+
uses: collin-miller/git-changesets@v1
2732
with:
2833
# Default format is 'csv'. Other valid options are 'space-delimited' and 'json'.
29-
format: space-delimited
34+
format: json
3035

3136
- name: Clean jsDelivr Cache
3237
run: |
33-
for i in ${{ steps.changed_files.outputs.added_modified }}; do
34-
# echo ${{ steps.changed_files.outputs.all }}
35-
curl -sL --retry 3 https://purge.jsdelivr.net/gh/vernesong/OpenClash@${{ github.ref_name }}/$i
36-
done
38+
echo "${{ steps.changed_files.outputs.added_modified }}" | jq -r '.[]' | while read file; do
39+
# echo ${{ steps.changed_files.outputs.all }}
40+
curl -sL --retry 3 "https://purge.jsdelivr.net/gh/vernesong/OpenClash@${{ github.ref_name }}/${file}"
41+
done

0 commit comments

Comments
 (0)