update-index #1162
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
# https://canovasjm.netlify.app/2020/11/29/github-actions-run-a-python-script-on-schedule-and-commit-changes/ | |
name: update-index | |
on: | |
workflow_dispatch: | |
schedule: | |
# run at 15:00 UTC every day (8am PDT/UTC-7) | |
- cron: '0 15 * * *' | |
jobs: | |
update-index: | |
runs-on: ubuntu-latest | |
steps: | |
- name: run actions/checkout@v4 | |
uses: actions/checkout@v4 | |
# fails: https://github.com/rasa/scoop-directory/runs/4252997621?check_suite_focus=true#step:7:8 | |
# - name: run actions/cache@v2 - pip | |
# uses: actions/cache@v2 | |
# id: pip | |
# with: | |
# path: ~/.cache/pip | |
# key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
# restore-keys: | | |
# ${{ runner.os }}-pip- | |
# causes errors, see | |
# https://github.com/rasa/scoop-directory/runs/4265697748?check_suite_focus=true#step:6:1097 | |
# - name: run actions/cache@v2 - cache | |
# uses: actions/cache@v2 | |
# id: cache | |
# with: | |
# path: cache | |
# key: ${{ runner.os }}-cache-${{ hashFiles('**/cache.pickle') }} | |
# restore-keys: | | |
# ${{ runner.os }}-cache- | |
- name: run actions/setup-python@v5 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
cache: 'pip' # caching pip dependencies | |
- name: run pip install -r maintenance/requirements.txt | |
# if: steps.pip.outputs.cache-hit != 'true' | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: run python maintenance/github-crawler.py | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: python maintenance/github-crawler.py | |
- name: run git commit -am "update index [ci skip]" | |
run: | | |
git config --local user.email "action@github.com" | |
git config --local user.name "GitHub Action" | |
git add -A | |
git commit -am "update index [ci skip]" | |
- name: run ad-m/github-push-action@v0.8.0 | |
uses: ad-m/github-push-action@v0.8.0 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: master |