chore: update KB index [skip ci]
This commit is contained in:
43
.github/workflows/kb-index-update.yml
vendored
Normal file
43
.github/workflows/kb-index-update.yml
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
name: Update KB Index
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
paths:
|
||||
- 'kb/**/*.md'
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
update:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Generate index
|
||||
run: |
|
||||
chmod +x kb/scripts/generate-index.sh
|
||||
./kb/scripts/generate-index.sh
|
||||
|
||||
- name: Check for changes
|
||||
id: check
|
||||
run: |
|
||||
if git diff --quiet kb/_index.md; then
|
||||
echo "changed=false" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "changed=true" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Commit changes
|
||||
if: steps.check.outputs.changed == 'true'
|
||||
run: |
|
||||
git config user.name "Gitea Actions"
|
||||
git config user.email "actions@gitea.io"
|
||||
git add kb/_index.md
|
||||
git commit -m "chore: update KB index [skip ci]" || exit 0
|
||||
git push
|
||||
|
||||
Reference in New Issue
Block a user