Update lastmod metadata #31
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 lastmod metadata | |
| on: | |
| schedule: | |
| - cron: "17 2 * * *" | |
| workflow_dispatch: | |
| jobs: | |
| update-lastmod: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 6 | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.x" | |
| - name: Render lastmod metadata | |
| env: | |
| LASTMOD_SOURCE_REF: ${{ github.sha }} | |
| run: python3 scripts/render_lastmod.py | |
| - name: Commit updated metadata | |
| run: | | |
| if git diff --quiet -- index.html en/index.html sitemap.xml; then | |
| exit 0 | |
| fi | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git add index.html en/index.html sitemap.xml | |
| git commit -m "Update lastmod metadata" | |
| git push |