From 13b8ec71f50078c9668a5d1af10123b920c2be90 Mon Sep 17 00:00:00 2001 From: claude Date: Mon, 22 Jun 2026 19:02:37 -0400 Subject: [PATCH] ci(wiki): run the wiki sync on the stack's docker runners; skip cleanly without a token MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - runs-on: docker (the shared Linux runners), matching the stack's build pattern. - If WIKI_TOKEN isn't set yet, log a warning and exit 0 (no red build) — the job still proves the runner picks it up. Real sync activates once the secret exists. Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_01TfzV5QvtPDz8LJS3Pu5VLT --- .gitea/workflows/sync-wiki.yml | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/.gitea/workflows/sync-wiki.yml b/.gitea/workflows/sync-wiki.yml index 984fb21..6b58b2e 100644 --- a/.gitea/workflows/sync-wiki.yml +++ b/.gitea/workflows/sync-wiki.yml @@ -1,11 +1,9 @@ # Render the course (single source of truth = modules/) into the Gitea wiki on # every push to main. The wiki is generated BUILD OUTPUT — never hand-edit it. # -# Prerequisites (one-time): -# 1. An Actions runner is attached to this repo/org (Settings -> Actions -> Runners). -# 2. A repo secret WIKI_TOKEN holds a token with write access to the wiki -# (a PAT/deploy token scoped to repository write is enough — NOT a site-admin token). -# 3. The wiki is initialized (it is — created with a Home page). +# Runs on the stack's shared `docker` runners (Linux). To actually push the wiki it +# needs a repo secret WIKI_TOKEN with wiki write (a scoped PAT/deploy token — NOT a +# site-admin token). Until that secret exists the job skips cleanly (stays green). name: Sync course wiki on: push: @@ -20,22 +18,21 @@ on: jobs: sync-wiki: - runs-on: ubuntu-latest + runs-on: docker steps: - - uses: actions/checkout@v7 - - uses: actions/setup-python@v6 - with: - python-version: '3.x' + - uses: actions/checkout@v4 - name: Render and push the wiki shell: bash env: WIKI_TOKEN: ${{ secrets.WIKI_TOKEN }} run: | set -euo pipefail + echo "runner: $(uname -srm) — $(python3 --version 2>/dev/null || echo 'python3 missing')" if [ -z "${WIKI_TOKEN:-}" ]; then - echo "::error::WIKI_TOKEN secret is not set — see this workflow's header." - exit 1 + echo "::warning::WIKI_TOKEN secret not set — skipping wiki sync. Add the secret to enable auto-sync." + exit 0 fi + command -v python3 >/dev/null || { apt-get update && apt-get install -y --no-install-recommends python3; } base="git.jpaul.io/justin/ai-workflow-course" git clone "https://claude:${WIKI_TOKEN}@${base}.wiki.git" wiki python3 tools/build_wiki.py --repo-root . --out wiki \ -- 2.52.0