-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (37 loc) · 1.25 KB
/
update-lists.yml
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
name: Update lists
on:
schedule:
- cron: '0 * * * *' # Run every hour at 0 minutes past the hour
workflow_dispatch:
jobs:
update-lists:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
- name: Set up Python 3.
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5
with:
python-version: 3.12
cache: 'pip' # caching pip dependencies
- run: pip install -r requirements.txt
- name: Generate list files
run: |
mkdir newlists
python3 update-lists.py --output-dir newlists
- name: Commit files
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git switch lists
cp -rf newlists/* lists/ && rm -rf newlists
git add lists
git commit -m "Automatically updated lists: $(date)" -a || true
- name: Push changes
uses: ad-m/github-push-action@77c5b412c50b723d2a4fbc6d71fb5723bcd439aa # master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: lists