ci(qibla): self-healing wiki-sync (bootstrap empty wiki, match other repos)

This commit is contained in:
Aric Camarata 2026-05-29 15:09:20 -04:00
parent 72ffd3659b
commit 0f62a0e904

View file

@ -3,7 +3,7 @@ name: Sync Wiki
on: on:
push: push:
branches: [main] branches: [main]
paths: [".github/wiki/**"] paths: ['.github/wiki/**']
workflow_dispatch: workflow_dispatch:
permissions: permissions:
@ -17,17 +17,14 @@ jobs:
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Checkout wiki - name: Checkout wiki
id: clone_wiki
run: | run: |
if git clone "https://x-access-token:${{ github.token }}@github.com/${{ github.repository }}.wiki.git" .wiki-remote 2>&1; then git clone "https://x-access-token:${{ github.token }}@github.com/${{ github.repository }}.wiki.git" .wiki-remote \
echo "wiki_exists=true" >> "$GITHUB_OUTPUT" || (mkdir -p .wiki-remote \
else && cd .wiki-remote \
echo "wiki_exists=false" >> "$GITHUB_OUTPUT" && git init \
echo "Wiki not yet initialized — skipping sync. Initialize via GitHub web UI first." && git remote add origin "https://x-access-token:${{ github.token }}@github.com/${{ github.repository }}.wiki.git")
fi
- name: Sync wiki pages - name: Sync wiki pages
if: steps.clone_wiki.outputs.wiki_exists == 'true'
run: | run: |
cp .github/wiki/*.md .wiki-remote/ cp .github/wiki/*.md .wiki-remote/
cd .wiki-remote cd .wiki-remote