-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
41 lines (35 loc) · 1.04 KB
/
clear_cache.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: Clean jsDelivr Cache
on:
push:
branches:
- master
- dev
- core
- package
paths-ignore:
- 'README.md'
- 'LICENSE'
jobs:
jsDelivr:
runs-on: ubuntu-latest
steps:
- name: Apt Update
env:
DEBIAN_FRONTEND: noninteractive
run: |
sudo apt-get update
sudo apt-get -y install jq
- uses: actions/checkout@v4
# https://github.com/marketplace/actions/git-changesets
- id: changed_files
name: git-changesets
uses: collin-miller/git-changesets@v1
with:
# Default format is 'csv'. Other valid options are 'space-delimited' and 'json'.
format: json
- name: Clean jsDelivr Cache
run: |
echo '${{ steps.changed_files.outputs.added_modified }}' | jq -r '.[]' | while read file; do
# echo ${{ steps.changed_files.outputs.all }}
curl -sL --retry 3 "https://purge.jsdelivr.net/gh/vernesong/OpenClash@${{ github.ref_name }}/${file}"
done