-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathupdate-root-downloads-shield-weekly.yml
More file actions
52 lines (45 loc) · 1.49 KB
/
update-root-downloads-shield-weekly.yml
File metadata and controls
52 lines (45 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Update root downloads shield
on:
schedule:
- cron: "45 5 * * 5" # every Fri @ 5:45 AM
workflow_dispatch:
jobs:
update-root-downloads-shield:
runs-on: ubuntu-24.04
permissions:
contents: write
env:
TZ: PST8PDT
steps:
- name: Checkout adamlui/python-utils
uses: actions/checkout@v6.0.2
with:
token: ${{ secrets.REPO_SYNC_PAT }}
- name: Set up Python
uses: actions/setup-python@v6.2.0
with:
python-version: 3.x
- name: Update README shield
id: update_shield
run: |
output=$(python3 utils/update_root_downloads_shield.py)
echo "$output"
if echo "$output" | grep -q "Shield updated!" ; then
echo "SHIELD_UPDATED=true" >> $GITHUB_ENV
else
echo "SHIELD_UPDATED=false" >> $GITHUB_ENV
fi
- name: Push changes
if: env.SHIELD_UPDATED == 'true'
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_PRIVATE_ID: ${{ secrets.GPG_PRIVATE_ID }}
run: |
gpg --batch --import <(echo "$GPG_PRIVATE_KEY")
git config --global commit.gpgsign true
git config --global user.name "kudo-sync-bot"
git config --global user.email "auto-sync@kudoai.com"
git config --global user.signingkey "$GPG_PRIVATE_ID"
git add docs/README.md
git commit -n -m "Updated downloads shield counter in root README"
git push