Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/workflows/wiki-sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Sync wiki

on:
push:
branches:
- main
paths:
- wiki/**
workflow_dispatch:

jobs:
sync:
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Checkout wiki repository
uses: actions/checkout@v4
with:
repository: ${{ github.repository }}.wiki
token: ${{ github.token }}
path: wiki-repo

- name: Push wiki folder to GitHub Wiki
run: |
git -C wiki-repo config user.name "github-actions[bot]"
git -C wiki-repo config user.email "github-actions[bot]@users.noreply.github.com"

Comment on lines +28 to +32
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The workflow embeds GITHUB_TOKEN directly in the clone URL. If git clone fails (e.g., wiki repo not initialized) the error output can include the full URL, potentially exposing the token in logs. Prefer using actions/checkout with repository: ${{ github.repository }}.wiki and token: ${{ github.token }} (or otherwise avoid putting credentials in the URL).

Suggested change
- name: Push wiki folder to GitHub Wiki
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
WIKI_REPO="https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.wiki.git"
git clone "$WIKI_REPO" wiki-repo
- name: Checkout wiki repository
uses: actions/checkout@v4
with:
repository: ${{ github.repository }}.wiki
token: ${{ github.token }}
path: wiki-repo
- name: Push wiki folder to GitHub Wiki
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"

Copilot uses AI. Check for mistakes.
# Copy wiki files while preserving the cloned repository metadata
rsync -av --delete \
--exclude=".git/" \
--exclude="WIKI_SETUP.md" \
wiki/ wiki-repo/

cd wiki-repo

git add -A

if git diff --cached --quiet; then
echo "No wiki changes to commit."
exit 0
fi

git commit -m "Sync wiki from main repo @ ${{ github.sha }}"
git push