Skip to content

Conversation

@mensfeld
Copy link
Collaborator

Summary

Adds a GitHub Action workflow to keep the public wiki repository (ruby-shoryuken/wiki) in sync with the hidden wiki (shoryuken.wiki).

How it works

Hidden wiki → Public wiki (this PR):

  • Triggers on gollum event (when wiki is edited via GitHub UI)
  • Can also be triggered manually via workflow_dispatch
  • Copies all files from hidden wiki to public wiki repo

Public wiki → Hidden wiki (in ruby-shoryuken/wiki repo):

  • Triggers on push to main branch
  • Syncs merged PRs back to the hidden wiki

Setup required

You need to create a WIKI_SYNC_TOKEN secret in both repos:

  1. Create a Personal Access Token (PAT) with repo scope
  2. Add it as a secret named WIKI_SYNC_TOKEN in:
    • ruby-shoryuken/shoryuken (Settings → Secrets → Actions)
    • ruby-shoryuken/wiki (Settings → Secrets → Actions)

Benefits

  • PRs can be made against ruby-shoryuken/wiki for wiki changes
  • Changes made via GitHub wiki UI are synced to public repo
  • Both wikis stay in sync automatically

@coderabbitai
Copy link

coderabbitai bot commented Dec 11, 2025

Warning

Rate limit exceeded

@mensfeld has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 7 minutes and 37 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 1fc2cac and 05bd64f.

📒 Files selected for processing (1)
  • .github/workflows/sync-wiki.yml (1 hunks)
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch add-wiki-sync-workflow

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Comment on lines +9 to +42
runs-on: ubuntu-latest
steps:
- name: Checkout hidden wiki
uses: actions/checkout@v4
with:
repository: ruby-shoryuken/shoryuken.wiki
path: hidden-wiki

- name: Checkout public wiki
uses: actions/checkout@v4
with:
repository: ruby-shoryuken/wiki
path: public-wiki
token: ${{ secrets.WIKI_SYNC_TOKEN }}

- name: Sync wikis
run: |
# Copy all files from hidden wiki to public wiki (excluding .git)
rsync -av --delete hidden-wiki/ public-wiki/ --exclude .git

cd public-wiki

# Check if there are changes
git add -A
if git diff --staged --quiet; then
echo "No changes to sync"
exit 0
fi

# Configure git and commit
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git commit -m "Sync from shoryuken.wiki"
git push

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI about 1 month ago

To fix the problem, add an explicit permissions: block at the job or workflow root specifying only the minimum required privileges for the workflow. Since the job interacts with repositories (performing git operations, but using a personal access token for push), at minimum it will need contents: read to check out code. If it never uses the GITHUB_TOKEN for write operations, contents: read is sufficient.
Best fix: Add

permissions:
  contents: read

at the top/root (just after name: and before on:), which ensures all jobs in the workflow only get read-only access to repository contents, unless overridden per-job.
No imports or extra definitions are required, just this change to the workflow YAML.


Suggested changeset 1
.github/workflows/sync-wiki.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/sync-wiki.yml b/.github/workflows/sync-wiki.yml
--- a/.github/workflows/sync-wiki.yml
+++ b/.github/workflows/sync-wiki.yml
@@ -1,4 +1,6 @@
 name: Sync Wiki
+permissions:
+  contents: read
 
 on:
   gollum:  # Triggers when the hidden wiki is edited via GitHub UI
EOF
@@ -1,4 +1,6 @@
name: Sync Wiki
permissions:
contents: read

on:
gollum: # Triggers when the hidden wiki is edited via GitHub UI
Copilot is powered by AI and may make mistakes. Always verify output.
@mensfeld
Copy link
Collaborator Author

Not needed - public wiki repo will be source of truth

@mensfeld mensfeld closed this Dec 11, 2025
@mensfeld mensfeld deleted the add-wiki-sync-workflow branch December 11, 2025 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants