Skip to content

Update Hugging Face Downloads #1

Update Hugging Face Downloads

Update Hugging Face Downloads #1

name: Update Hugging Face Downloads
on:
schedule:
- cron: '0 0 * * 0' # Runs every Sunday at midnight (00:00 UTC)
workflow_dispatch: # Allows manual triggering
jobs:
update_downloads:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Get Hugging Face Model Download Count
run: |
curl -s https://huggingface.co/api/models/zhreyu/ComicStrips-Lora-Fluxdev | jq '.downloads' > download_count.txt
- name: Update README.md
run: |
DOWNLOADS=$(cat download_count.txt)
sed -i 's/Total Downloads: \[!\[Downloads\](https:\/\/img.shields.io\/badge\/downloads-[0-9]*-blue)\]/Total Downloads: \[!\[Downloads\](https:\/\/img.shields.io\/badge\/downloads-'${DOWNLOADS}'-blue)\]/' README.md
- name: Commit changes
run: |
git config --global user.name 'github-actions'
git config --global user.email '[email protected]'
git add README.md
git commit -m "Update Hugging Face model downloads"
git push