mirror of
https://github.com/mortyzip/KeepAwake.git
synced 2026-10-17 16:02:05 +02:00
Remove the download stats workflow
This commit is contained in:
1 file changed
-45
@@ -1,45 +0,0 @@
|
||||
name: Download stats
|
||||
|
||||
# Appends the release download counts and star count to downloads.csv on the
|
||||
# stats branch once a day, so there's a history to look at.
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '17 6 * * *'
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
log:
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Log counts
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||
|
||||
if git ls-remote --exit-code --heads origin stats >/dev/null; then
|
||||
git fetch origin stats
|
||||
git checkout -B stats origin/stats
|
||||
else
|
||||
git checkout --orphan stats
|
||||
git rm -rf . -q
|
||||
echo "date,release,file,downloads,stars" > downloads.csv
|
||||
fi
|
||||
|
||||
day=$(date -u +%F)
|
||||
stars=$(gh api "repos/$GITHUB_REPOSITORY" --jq .stargazers_count)
|
||||
gh api "repos/$GITHUB_REPOSITORY/releases" --paginate \
|
||||
--jq ".[] | .tag_name as \$t | .assets[] | \"$day,\(\$t),\(.name),\(.download_count),$stars\"" \
|
||||
>> downloads.csv
|
||||
|
||||
git add downloads.csv
|
||||
git commit -m "Download stats for $day"
|
||||
git push origin stats
|
||||
Reference in new issue
Block a user