Some checks failed
Regenerate Documentation Index / regenerate-index (push) Failing after 7s
- Improved tag extraction with 60+ digiBandit-specific keywords - Better description extraction (skip metadata, clean markdown) - Added related docs detection based on folder/tags - Added Forgejo Action workflow for auto-regeneration - Added tools/generate_index.py for standalone index generation
61 lines
1.7 KiB
YAML
61 lines
1.7 KiB
YAML
name: Regenerate Documentation Index
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- '**.md'
|
|
- 'tools/generate_index.py'
|
|
|
|
jobs:
|
|
regenerate-index:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 2
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.11'
|
|
|
|
- name: Check if markdown files changed
|
|
id: check_changes
|
|
run: |
|
|
# Get list of changed files
|
|
CHANGED_FILES=$(git diff --name-only HEAD^ HEAD)
|
|
|
|
# Check if any .md files changed (excluding .docs-index.json)
|
|
if echo "$CHANGED_FILES" | grep -q '\.md$'; then
|
|
echo "md_changed=true" >> $GITHUB_OUTPUT
|
|
else
|
|
echo "md_changed=false" >> $GITHUB_OUTPUT
|
|
fi
|
|
|
|
- name: Generate documentation index
|
|
if: steps.check_changes.outputs.md_changed == 'true'
|
|
run: |
|
|
python tools/generate_index.py
|
|
|
|
- name: Check if index changed
|
|
if: steps.check_changes.outputs.md_changed == 'true'
|
|
id: check_index
|
|
run: |
|
|
if git diff --quiet .docs-index.json; then
|
|
echo "index_changed=false" >> $GITHUB_OUTPUT
|
|
else
|
|
echo "index_changed=true" >> $GITHUB_OUTPUT
|
|
fi
|
|
|
|
- name: Commit and push index
|
|
if: steps.check_index.outputs.index_changed == 'true'
|
|
run: |
|
|
git config user.name "digiBandit"
|
|
git config user.email "joey.king@dbits.ca"
|
|
git add .docs-index.json
|
|
git commit -m "Update documentation index (auto-generated)"
|
|
git push
|