Skip to content

OpenWiki: keep openwiki/INSTRUCTIONS.md through from-scratch wipes - #38

Merged
krishagel merged 1 commit into
mainfrom
fix/openwiki-keep-instructions
Oct 31, 2026
Merged

krishagel merged 1 commit into
mainfrom
fix/openwiki-keep-instructions

Conversation

@krishagel

Copy link
Copy Markdown
Member

Fixes #21.

reusable-openwiki.yml ran rm -rf openwiki in two places: the from-scratch smoke-test step and the retry after an empty first build. Both deleted openwiki/INSTRUCTIONS.md, the owner's brief from standards/06.

  • Impact: the retry build ran without the brief, and the docs PR (add-paths: openwiki, auto-merged) committed the deletion.
  • Fix: both wipes now remove everything under openwiki/ except INSTRUCTIONS.md. A -d guard means a missing directory doesn't fail the step under bash -e.
  • Page counts: the retry threshold and the > 2 pages gate now exclude INSTRUCTIONS.md. Without that, index.md + one page + INSTRUCTIONS.md would pass the "an index alone is not a wiki" check.
  • Tested: the wipe and count logic were run locally under bash -e in three cases: INSTRUCTIONS.md present, absent, and openwiki/ missing. actionlint wasn't run locally. The OpenWiki smoke test needs BEDROCK_API_KEY.
  • Release: PATCH.

…ixes #21)

reusable-openwiki.yml ran 'rm -rf openwiki' in two places:
- the 'Remove existing wiki (from-scratch smoke test)' step, and
- the one-time retry inside 'Run OpenWiki' when a first build comes out
  with <= 2 pages.

Both removed openwiki/INSTRUCTIONS.md, the owner-authored brief that
standards/06 tells repos to add when their source carries infrastructure
details (IPs, hostnames, account names). Two consequences:
1. The retry build ran without the brief, so the second openwiki run
   had none of the owner's scope or redaction guidance.
2. With add-paths: openwiki, the docs PR committed the deletion, and
   the auto-merge step could land it unreviewed.

openwiki 0.3.3's own prompt treats /openwiki/INSTRUCTIONS.md as
user-authored and never rewrites it, so it is not generated output and
should survive a wipe.

Changes:
- Both wipes now delete only the direct children of openwiki/ other than
  INSTRUCTIONS.md:
    if [ -d openwiki ]; then find openwiki -mindepth 1 -maxdepth 1 \
      ! -name INSTRUCTIONS.md -exec rm -rf {} +; fi
  The -d guard keeps the step from failing under bash -e when openwiki/
  doesn't exist (the old rm -rf was a no-op there).
- The page counts in 'Run OpenWiki' (retry threshold) and 'Verify the
  run completed' (the > 2 pages gate and step summary) now exclude
  openwiki/INSTRUCTIONS.md. Previously the retry deleted the file before
  the verify count, so the count never included it. Keeping the file
  without excluding it would let index.md + one page + INSTRUCTIONS.md
  pass the 'an index alone is not a wiki' gate.

Tested locally under bash -e: a tree with INSTRUCTIONS.md, index.md,
.last-update.json and sub/a.md counts 2 pages and wipes to just
INSTRUCTIONS.md; a tree without INSTRUCTIONS.md wipes to an empty
directory; a missing openwiki/ wipes without error and counts 0.
actionlint was not run locally.

Release: PATCH (behavior fix, callers unaffected).
@krishagel
krishagel merged commit 47db563 into main Oct 31, 2026
4 checks passed
@krishagel
krishagel deleted the fix/openwiki-keep-instructions branch October 31, 2026 19:27
krishagel added a commit that referenced this pull request Nov 1, 2026
Moves all six reusable references in workflow-templates/ from
8c4dbb4 (v1.1.0) to
75e88dd (v1.1.1), per step 3 of
RELEASING.md (Dependabot doesn't scan this folder).

Files: claude-review.yml (reusable-claude-review and
reusable-claude-review-skip), openwiki.yml, psd-ci.yml,
publish-plugin.yml, security-scan.yml.

v1.1.1 (run 41264437323, tag at main 75e88dd) contains #31, #32, #34,
#35, #36, #37, #38 and #39: action SHA bumps (create-github-app-token
3.3.0, setup-node 7.1.0, dependency-review-action 5.0.0,
claude-code-action 1.0.251, setup-uv 10.3.0), the pin-comment fix,
keeping openwiki/INSTRUCTIONS.md through from-scratch wipes, and the
OpenWiki CLI bump to 0.7.2. All PATCH-level; no caller inputs, secrets,
job names or permissions changed.
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.

reusable-openwiki: the empty-first-build retry deletes openwiki/INSTRUCTIONS.md

1 participant