Update repository #1545
This file contains hidden or 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 repository | |
| on: | |
| schedule: | |
| - cron: '0 6 * * *' | |
| workflow_dispatch: | |
| jobs: | |
| update: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v5 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '^3.11' | |
| - name: Set up environment | |
| run: | | |
| git config --global user.email "[email protected]" | |
| git config --global user.name "GitHub Almighty" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade tox | |
| - name: Run script | |
| # No space between `-e` and `run` or tox gets confused | |
| run: tox -erun -- -l DEBUG --hosts GitHub,OSF | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.SEARCH_GITHUB_TOKEN }} | |
| - name: Push changes | |
| run: | | |
| ahead="$(git rev-list --count --right-only @{upstream}...HEAD)" | |
| if [ "$ahead" -gt 0 ] | |
| then git push | |
| else echo "No commits to push" | |
| fi | |
| # vim:set et sts=2: |