mirror of
https://github.com/Suwayomi/docker-tachidesk.git
synced 2025-12-10 06:42:12 +01:00
restore save_pull_count
This commit is contained in:
37
.github/workflows/save_docker_pull_count.yml
vendored
Normal file
37
.github/workflows/save_docker_pull_count.yml
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
name: Save Docker Pull Count
|
||||
on:
|
||||
workflow_dispatch:
|
||||
# schedule:
|
||||
# - cron: "0 11 * * *"
|
||||
|
||||
jobs:
|
||||
save_pull_count:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
ref: main
|
||||
path: main
|
||||
fetch-depth: 0
|
||||
|
||||
- name: save total downloads
|
||||
run: |
|
||||
cd main
|
||||
total_downloads_previous=$(jq -r '.total_downloads' scripts/tachidesk_version.json)
|
||||
total_downloads=$(curl -s https://github.com/Suwayomi/docker-tachidesk/pkgs/container/tachidesk | grep -A1 "Total downloads" | tr -d \\n | egrep -o "Total download.*.=\"[0-9]+\">" | cut -f2 -d"=" | egrep -o "[0-9]+")
|
||||
if [[ $total_downloads != $total_downloads_previous ]]; then
|
||||
git pull
|
||||
echo "`jq --arg value "$total_downloads" '.total_downloads=$value' scripts/tachidesk_version.json`" > scripts/tachidesk_version.json
|
||||
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git config --global user.name "github-actions[bot]"
|
||||
git status
|
||||
if [ -n "$(git status --porcelain)" ]; then
|
||||
git pull
|
||||
git add .
|
||||
git commit -a -m "Update docker pull count"
|
||||
git push
|
||||
else
|
||||
echo "No changes to commit"
|
||||
fi
|
||||
fi
|
||||
Reference in New Issue
Block a user