Sfoglia il codice sorgente

docs: auto-bump Last updated on doc changes

- add .github/workflows/docs-last-updated.yml: on push to dev where docs/** or README.md changed, updates any '*Last updated: YYYY-MM-DD*' to today and pushes with [skip ci]
- bump docs/features.md 2026-08-30 -> 2026-09-01 (now in sync, future bumps automatic)
TheWildJames 1 settimana fa
parent
commit
125b49503a
2 ha cambiato i file con 50 aggiunte e 1 eliminazioni
  1. 49 0
      .github/workflows/docs-last-updated.yml
  2. 1 1
      docs/features.md

+ 49 - 0
.github/workflows/docs-last-updated.yml

@@ -0,0 +1,49 @@
+name: Docs Last Updated
+
+on:
+  push:
+    branches: [dev]
+    paths:
+      - "docs/**"
+      - "README.md"
+  workflow_dispatch:
+
+permissions:
+  contents: write
+
+jobs:
+  stamp:
+    if: github.actor != 'github-actions[bot]'
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v4
+        with:
+          fetch-depth: 0
+          token: ${{ secrets.GITHUB_TOKEN }}
+
+      - name: Update Last updated date
+        run: |
+          TODAY=$(date -u +%Y-%m-%d)
+          echo "Today: $TODAY"
+          changed=0
+          for f in docs/*.md; do
+            [ -f "$f" ] || continue
+            if grep -q "Last updated" "$f"; then
+              # replace any *Last updated: YYYY-MM-DD* or *Last updated: YYYY-MM-DD.* line
+              sed -i -E "s/\\*Last updated: [0-9]{4}-[0-9]{2}-[0-9]{2}\\.?\\*/\\*Last updated: $TODAY.\\*/g" "$f"
+              # also handle bare *Last updated: YYYY-MM-DD* without trailing period inside italics
+              sed -i -E "s/\\*Last updated: [0-9]{4}-[0-9]{2}-[0-9]{2}\\*/\\*Last updated: $TODAY.\\*/g" "$f"
+            fi
+          done
+          git diff --quiet && echo "no doc date changes" && exit 0
+          git diff --stat
+          git config user.name "github-actions[bot]"
+          git config user.email "github-actions[bot]@users.noreply.github.com"
+          git add docs/*.md
+          # only commit if staged changes exist
+          git diff --cached --quiet && exit 0
+          git commit -m "docs: bump Last updated to $TODAY [skip ci]"
+          git push
+
+      - name: Summary
+        run: echo "Last updated stamp checked"

+ 1 - 1
docs/features.md

@@ -2,7 +2,7 @@
 
 Per-feature documentation for the GKI2 kernels built from this repository.
 
-*Last updated: 2026-08-30*
+*Last updated: 2026-09-01*
 
 ---