Fetch Remote Assets #1963
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: Fetch Remote Assets | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '00 00 * * *' | |
| permissions: | |
| contents: write | |
| env: | |
| BRANCH: fetch-includes | |
| jobs: | |
| fetch: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: true | |
| token: ${{ secrets.NESI_PAT }} | |
| - name: Configure Git | |
| run: | | |
| git config user.name "nesi-mkdocs-bot" | |
| git config user.email "bots-mkdocs@nesi.org.nz" | |
| - name: Fetch remote assets | |
| run: bash .github/fetch_includes.sh | |
| - name: Commit if Changes | |
| id: changes | |
| run: | | |
| if git diff --quiet -- . ':(exclude)*.ics'; then | |
| echo "no changes" | |
| else | |
| git add -A | |
| git commit -m "Automatic asset update ($(date +'%c'))" | |
| git push origin main | |
| fi |