Update lists #6651
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |