An open API service indexing awesome lists of open source software.

https://github.com/angrido/purge-camo-cache

Purge Camo Cache refreshes cached images from camo.githubusercontent.com, ensuring updates are instantly visible
https://github.com/angrido/purge-camo-cache

githubusercontent purgecache

Last synced: 4 months ago
JSON representation

Purge Camo Cache refreshes cached images from camo.githubusercontent.com, ensuring updates are instantly visible

Awesome Lists containing this project

README

          


GitHub Action
MIT License

๐Ÿ”„ Purge Camo Cache


Keep your GitHub images fresh!

A GitHub Action that purges cached images served via camo.githubusercontent.com.

---

## โ“ Why?

GitHub uses **Camo** as a caching proxy to serve images securely. But Camo doesn't refresh images automatically โ€” so your badges and images can stay stale for hours. This action forces a cache purge so updates show up instantly. โšก

## ๐Ÿš€ Quick Start

Add this workflow to your repository:

```yaml
name: Purge Camo Cache

on:
push:
branches:
- main
schedule:
- cron: '0 */2 * * *'

jobs:
purge-camo-cache:
runs-on: ubuntu-latest

steps:
- name: Purge Camo Cache
uses: Angrido/Purge-Camo-Cache@v1.3.0
```

๐Ÿ”’ For **private repositories**, pass a token with read access:

```yaml
- name: Purge Camo Cache
uses: Angrido/Purge-Camo-Cache@v1.3.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
```

## ๐Ÿ“ฅ Inputs

| Name | Required | Default | Description |
|---------|----------|----------------------|-----------------------------------|
| `token` | No | `${{ github.token }}` | ๐Ÿ”‘ GitHub token for authentication. |

## โš™๏ธ How It Works

1. ๐ŸŒฟ Detects the current branch using `tj-actions/branch-names`.
2. ๐Ÿ” Fetches the repository page and extracts all `camo.githubusercontent.com` image URLs.
3. ๐Ÿงน Sends a `PURGE` request to each URL to invalidate the cache.

---


Made with โค๏ธ by Angrido