Skip to content

Build WALLET_DIRECTORY.md after merge instead of in each PR - #32

Merged
hythloda merged 1 commit into
mainfrom
build-directory-after-merge
Nov 19, 2026
Merged

hythloda merged 1 commit into
mainfrom
build-directory-after-merge

Conversation

@davidrichards-da

Copy link
Copy Markdown
Contributor

Why

Every PR currently commits its own regenerated WALLET_DIRECTORY.md. When two PRs are open at once, they always conflict on that file. Resolving the conflict by keeping one side's copy silently drops the other PR's wallet, and because approvals are dismissed on new commits, every rebase sends the PR back for approval. That's why #24–#30 had to be combined into #31.

What changes

For contributors: commit only wallets/ and proofs/ files. WALLET_DIRECTORY.md is no longer part of any PR.

verify-wallet-directory.yml (PR check, job verify)

  • Builds the page from the PR merged into the latest main, and fails if the generator errors.
  • Uploads the built page as a wallet-directory-preview artifact so contributors and reviewers can see the result.
  • Checks that proof files exist (unchanged).
  • Fails if the PR edits WALLET_DIRECTORY.md, and tells the author the one command that drops it.
  • Now runs on every PR (no paths filter), so it can be made a required status check without blocking docs-only PRs.

publish-wallet-directory.yml (new; runs after each merge to main)

  • Rebuilds WALLET_DIRECTORY.md from everything on main and commits it if it changed.
  • Runs one at a time and always checks out the newest main, so back-to-back merges can't publish an older page over a newer one.

Docs: CONTRIBUTING.md (new-wallet, update, verifier steps; the "Regenerating" section becomes "Previewing the summary page"), the PR template checklist, README, wallets/TEMPLATE.yaml and the generator's docstring. Local preview: python3 scripts/generate_table.py --out WALLET_DIRECTORY.preview.md (git-ignored).

Admin setup needed (one time)

main requires a reviewed PR, and the default Actions token can't bypass that. To let the publish workflow commit directly:

  1. Create a GitHub App owned by the canton-foundation org with Repository permissions → Contents: Read and write, and install it on this repo only.
  2. Settings → Branches → main → Allow specified actors to bypass required pull requests: add the App.
  3. Settings → Secrets and variables → Actions: add the variable DIRECTORY_BOT_APP_ID and the secret DIRECTORY_BOT_PRIVATE_KEY.

Until then the workflow still works. It opens, and keeps updating, a single "Regenerate WALLET_DIRECTORY.md" PR from bot/wallet-directory, and merging that publishes every change merged so far. PRs opened by the Actions token don't trigger CI, so if verify is made required, set up the App first.

Recommended: make verify a required status check on main once this merges.

Tested locally

  • All three workflow files parse as valid YAML.
  • The generator writes WALLET_DIRECTORY.md (11 wallets) and the current table on main is already up to date, so the first publish run will be a no-op. --out WALLET_DIRECTORY.preview.md is git-ignored.
  • Simulated the "must not edit" check on merge commits: a YAML-only PR passes, and a PR that edits WALLET_DIRECTORY.md fails.
  • verify_proof_links.py and verify_proof_anchors.py pass.
  • Not tested: the workflows running on GitHub itself. The verify run on this PR is the first real test, and the publish workflow first runs after a merge that touches wallets/.

🤖 Generated with Claude Code

Every PR used to commit its own regenerated WALLET_DIRECTORY.md, so two
PRs opened on the same day always conflicted on it, and resolving that
conflict the wrong way could silently drop an earlier wallet.

- New workflow publish-wallet-directory.yml rebuilds the page on main
  after every merge and commits it (via an optional GitHub App on the
  branch-protection bypass list; otherwise it keeps one
  "Regenerate WALLET_DIRECTORY.md" PR up to date).
- verify-wallet-directory.yml now builds the page from the PR merged
  into main, uploads it as a preview artifact, checks proof links, and
  fails if a PR edits WALLET_DIRECTORY.md. It runs on every PR, so it
  can be made a required check.
- CONTRIBUTING.md, the PR template, README, TEMPLATE.yaml and the
  generator's docstring describe the new steps: commit only wallets/
  and proofs/, preview with --out WALLET_DIRECTORY.preview.md
  (git-ignored).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@hythloda
hythloda merged commit f0aaf77 into main Nov 19, 2026
2 checks passed
@hythloda
hythloda deleted the build-directory-after-merge branch November 19, 2026 14:14
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