actions-hugo/.github/workflows/purge-readme-image-cache.yml

20 lines
413 B
YAML
Raw Normal View History

name: Purge image cache
on:
push:
branches:
- master
schedule:
- cron: '4 18 * * *'
jobs:
purge:
runs-on: ubuntu-18.04
steps:
- run: |
IMAGE_LIST=$(curl -sL https://github.com/${GITHUB_REPOSITORY} | \
grep -oE '<img src="https?://camo.githubusercontent.com/[^"]+' | \
sed -e 's/<img src="//')
echo ${IMAGE_LIST} | xargs -I % curl -sX PURGE %