Skip to content

chore: sync wiki/ folder to GitHub Wiki via Actions workflow#6

Merged
Foscat merged 2 commits intomainfrom
copilot/fix-wiki-tab-issue
Apr 10, 2026
Merged

chore: sync wiki/ folder to GitHub Wiki via Actions workflow#6
Foscat merged 2 commits intomainfrom
copilot/fix-wiki-tab-issue

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 9, 2026

Wiki content existed in wiki/ in the main repo but never reached the GitHub Wiki tab because GitHub's wiki is a separate git repository that requires an explicit push.

Summary

Adds a GitHub Actions workflow that checks out the .wiki.git repo via actions/checkout@v4 and syncs the wiki/ folder into it using rsync (excluding WIKI_SETUP.md and .git/), then commits and pushes any changes. Triggers on pushes to main that touch wiki/**, and supports manual dispatch.

Security and hygiene improvements based on review feedback:

  • Wiki repo is checked out with actions/checkout@v4 using token: ${{ github.token }} — credentials are never embedded in a URL that could be exposed in error logs.
  • Git author identity is configured with git -C wiki-repo config to scope it to the wiki clone only, not the runner's global git config.
  • rsync --delete excludes .git/ to prevent wiping the cloned repo's git metadata before the commit/push steps run.

Scope

  • bug fix
  • feature
  • docs
  • tests
  • release/chore

Validation

Workflow logic verified by inspection. No CSS, JS, or package changes — standard linting and test runs are not applicable here.

# No applicable npm commands for a workflow-only change

API and Behavior Impact

  • no public API changes
  • class API changed
  • token contract changed
  • accessibility behavior changed
  • motion behavior changed
  • browser behavior changed

Documentation

  • README updated (if needed)
  • wiki updated (if needed)
  • CHANGELOG updated (if needed)

Notes

One-time manual bootstrap required: GitHub only initializes the wiki git repo after a first page is created via the UI. Go to the Wiki tab → "Create the first page" → save anything. After that, merge this PR and trigger the workflow (manually or via a wiki/ change on main) to fully populate the wiki.

The workflow uses GITHUB_TOKEN with contents: write — no extra secrets needed.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds automation to keep the repository’s wiki/ folder in sync with the GitHub Wiki (separate .wiki.git repo) via a GitHub Actions workflow, triggered on main updates affecting wiki/** and via manual dispatch.

Changes:

  • Introduces a new Actions workflow to clone the GitHub Wiki repo and sync content from wiki/ using rsync.
  • Excludes wiki/WIKI_SETUP.md from being published to the GitHub Wiki.
  • Commits and pushes wiki changes only when there are actual diffs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/wiki-sync.yml Outdated
Comment on lines +30 to +31
# Copy wiki files, excluding the setup notes file
rsync -av --delete \
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.

rsync --delete will delete files in wiki-repo/ that don't exist in wiki/, including the cloned repo’s .git/ directory. That will break subsequent git add/commit/push (or leave the repo in a non-git state). Exclude .git/ from the rsync (or run rsync from inside wiki-repo while explicitly preserving .git/).

Suggested change
# Copy wiki files, excluding the setup notes file
rsync -av --delete \
# Copy wiki files while preserving the cloned repository metadata
rsync -av --delete \
--exclude=".git/" \

Copilot uses AI. Check for mistakes.
Comment on lines +21 to +29
- 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

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.
Comment thread .github/workflows/wiki-sync.yml Outdated
Comment on lines +23 to +28
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
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.

Using git config --global modifies the runner’s global git config for the rest of the job. Prefer configuring the cloned wiki repo only (e.g., git -C wiki-repo config user.name/...) to keep the step self-contained.

Suggested change
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
WIKI_REPO="https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.wiki.git"
git clone "$WIKI_REPO" wiki-repo
git -C wiki-repo config user.name "github-actions[bot]"
git -C wiki-repo config user.email "github-actions[bot]@users.noreply.github.com"

Copilot uses AI. Check for mistakes.
@Foscat
Copy link
Copy Markdown
Owner

Foscat commented Apr 9, 2026

@copilot apply changes based on the comments in this thread

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 9, 2026

@copilot apply changes based on the comments in this thread

Applied all three review suggestions in d556a44:

  • Token in clone URL → replaced manual git clone with a dedicated actions/checkout@v4 step using token: ${{ github.token }}, so credentials never appear in logs.
  • git config --global → switched to git -C wiki-repo config user.name/user.email to scope the config to the wiki repo only.
  • rsync --delete removing .git/ → added --exclude=".git/" to preserve the cloned repo metadata.

Copilot AI requested a review from Foscat April 9, 2026 23:58
@Foscat
Copy link
Copy Markdown
Owner

Foscat commented Apr 9, 2026

@copilot apply changes based on the comments in this thread

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 9, 2026

@copilot apply changes based on the comments in this thread

All three changes were already applied in d556a44 — the current file has actions/checkout@v4 for the wiki repo checkout (no token in URL), git -C wiki-repo config scoping, and --exclude=".git/" on the rsync. No further changes needed.

@Foscat Foscat marked this pull request as ready for review April 10, 2026 00:00
Copy link
Copy Markdown
Owner

@Foscat Foscat left a comment

Choose a reason for hiding this comment

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

Looks good to me and good job!

@Foscat Foscat merged commit 2686c80 into main Apr 10, 2026
1 check passed
@Foscat Foscat deleted the copilot/fix-wiki-tab-issue branch April 10, 2026 00:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants