forked from quantopian/pyfolio
-
Notifications
You must be signed in to change notification settings - Fork 1
48 lines (38 loc) · 1.51 KB
/
badge-refresh.yml
File metadata and controls
48 lines (38 loc) · 1.51 KB
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
42
43
44
45
46
47
48
name: Refresh Badges
on:
# Run after CI completes
workflow_run:
workflows: ["CI"]
types:
- completed
# Allow manual trigger
workflow_dispatch:
jobs:
refresh-badges:
name: Refresh README badges
runs-on: ubuntu-latest
if: github.repository == 'cloudQuant/pyfolio'
steps:
- name: Refresh CI Badge Cache
run: |
# Force refresh GitHub's badge cache by making requests with cache-busting
echo "Refreshing CI badge cache..."
# Wait a moment for GitHub's systems to update
sleep 30
# Make requests to refresh badge cache
curl -I "https://github.com/cloudQuant/pyfolio/actions/workflows/ci.yml/badge.svg?branch=master&$(date +%s)" || true
curl -I "https://github.com/cloudQuant/pyfolio/actions/workflows/quick-test.yml/badge.svg?branch=master&$(date +%s)" || true
echo "Badge cache refresh completed"
- name: Purge Badge CDN Cache
run: |
# Use different methods to force badge refresh
echo "Purging CDN caches..."
# Make requests with different user agents and cache busting
for i in {1..3}; do
curl -H "Cache-Control: no-cache" \
-H "Pragma: no-cache" \
-H "User-Agent: BadgeRefresh-$i" \
"https://img.shields.io/github/actions/workflow/status/cloudQuant/pyfolio/ci.yml?branch=master&$(date +%s)" || true
sleep 5
done
echo "CDN cache purge completed"