ci: skip wiki sync gracefully when wiki not yet initialized

This commit is contained in:
Aric Camarata 2026-03-08 17:02:05 -04:00
parent 0fb9b8bd35
commit d59a92f413

View file

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