Skip to content

Fix for permissions issues after adding GitHub action to insert the d… #7

Fix for permissions issues after adding GitHub action to insert the d…

Fix for permissions issues after adding GitHub action to insert the d… #7

Workflow file for this run

name: Update index.html
on:
push:
branches:
- main
jobs:
update:
if: github.actor != 'github-actions[bot]'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4 # Update to the latest version compatible with Node.js 20
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GH_PAT }}
- name: Replace __LAST_UPDATE__ placeholder
run: |
DATE=`date +%Y-%m-%d`
sed -i "s/__LAST_UPDATE__/$DATE/g" index.html
- name: Commit and push if it changed
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "GitHub Actions"
git add index.html
git diff --quiet && git diff --staged --quiet || git commit -m "Update __LAST_UPDATE__ in index.html" && git push