ci: refuse CLAUDE.md in any letter case and keep .apm-local out of the build #333

Merged
Defame1297 merged 4 commits from ci/refuse-claude-md-any-case into main 2026-11-23 20:33:04 +00:00
Owner

What and why

Follow-up to #330 (#244). No issue: two one-line fixes found in its review, bundled into one pull request at the maintainer's request, one commit each.

  • .pre-commit-config.yaml: the refuse-claude-md hook matches (?i)(^|/)(\.claude/)?claude(\.local)?\.md$. The old pattern was case-sensitive, so claude.md or CLAUDE.MD passed it, while a case-insensitive file system serves such a file as CLAUDE.md.
  • .gitea/workflows/image.yml: ci image 0.2.37 → 0.2.38, because .pre-commit-config.yaml is an image input. The digest-pin pull request follows after the image builds.
  • galaxy.yml: .apm-local in build_ignore. It is apm's local state directory and ignores itself through its own .gitignore, so a local ansible-galaxy collection build copied it into the archive and check_tarball.py refused it (test_real_build_passes failed in a local clone; CI checkouts never have it).
  • No changelog fragment: no consumer-visible change.

Verified

  • pre-commit run refuse-claude-md --files …: fails on claude.md, CLAUDE.MD, .claude/Claude.md, roles/x/claude.local.md, CLAUDE.md; skips docs/CLAUDE-notes.md and docs/claude-notes.md.
  • python3 -m unittest discover -s tests/scripts in a local clone that has .apm-local/: 244 tests OK, including test_real_build_passes.
  • pre-commit run --all-files passes; check_image_versions.py bump origin/main and pins print ok against the current main; pre-push ansible-test sanity passed.

Not verified

  • CI on this pull request, the 0.2.38 ci image build after merge and the follow-up digest-pin pull request.
  • Whether Claude Code reads a lowercase claude.md on a case-insensitive file system was not tested in a session; the hook refuses it either way.

  • I confirm third-party material is recorded in NOTICE and REUSE.toml, or there is none.

Assisted-by: Claude Code

## What and why Follow-up to #330 (#244). No issue: two one-line fixes found in its review, bundled into one pull request at the maintainer's request, one commit each. - **`.pre-commit-config.yaml`**: the `refuse-claude-md` hook matches `(?i)(^|/)(\.claude/)?claude(\.local)?\.md$`. The old pattern was case-sensitive, so `claude.md` or `CLAUDE.MD` passed it, while a case-insensitive file system serves such a file as `CLAUDE.md`. - **`.gitea/workflows/image.yml`**: `ci` image 0.2.37 → 0.2.38, because `.pre-commit-config.yaml` is an image input. The digest-pin pull request follows after the image builds. - **`galaxy.yml`**: `.apm-local` in `build_ignore`. It is apm's local state directory and ignores itself through its own `.gitignore`, so a local `ansible-galaxy collection build` copied it into the archive and `check_tarball.py` refused it (`test_real_build_passes` failed in a local clone; CI checkouts never have it). - No changelog fragment: no consumer-visible change. ## Verified - `pre-commit run refuse-claude-md --files …`: fails on `claude.md`, `CLAUDE.MD`, `.claude/Claude.md`, `roles/x/claude.local.md`, `CLAUDE.md`; skips `docs/CLAUDE-notes.md` and `docs/claude-notes.md`. - `python3 -m unittest discover -s tests/scripts` in a local clone that has `.apm-local/`: 244 tests OK, including `test_real_build_passes`. - `pre-commit run --all-files` passes; `check_image_versions.py bump origin/main` and `pins` print ok against the current `main`; pre-push `ansible-test sanity` passed. ## Not verified - CI on this pull request, the 0.2.38 `ci` image build after merge and the follow-up digest-pin pull request. - Whether Claude Code reads a lowercase `claude.md` on a case-insensitive file system was not tested in a session; the hook refuses it either way. --- - [x] I confirm third-party material is recorded in `NOTICE` and `REUSE.toml`, or there is none. Assisted-by: Claude Code
Claude added this to the Open to contributors milestone 2026-11-23 20:05:02 +00:00
Defame1297 was assigned by Claude 2026-11-23 20:05:02 +00:00
Claude added 2 commits 2026-11-23 20:05:02 +00:00
The refuse-claude-md pattern was case-sensitive, so claude.md or CLAUDE.MD
passed it, yet a case-insensitive file system serves either as CLAUDE.md.
Match with the inline (?i) flag. The hook config is a ci image input, so
the ci image moves from 0.2.37 to 0.2.38.

Assisted-by: Claude Code
build(galaxy): keep .apm-local out of the Collection build
Lint / lint (pull_request) Canceled after 0s
Molecule / molecule (pull_request) Canceled after 0s
Build / build (pull_request) Canceled after 3s
cca31f44a1
.apm-local/ is apm's local state directory and ignores itself through its
own .gitignore, so a local ansible-galaxy collection build copied it into
the archive, where check_tarball.py rejects it as a disallowed top-level
entry.

Assisted-by: Claude Code
CODEOWNERS rules requested review from Defame1297 2026-11-23 20:05:02 +00:00
Defame1297 added 1 commit 2026-11-23 20:08:31 +00:00
Merge branch 'main' into ci/refuse-claude-md-any-case
Build / build (pull_request) Canceled after 0s
Molecule / molecule (pull_request) Canceled after 0s
Lint / lint (pull_request) Canceled after 1m28s
f21a535a87
Defame1297 added 1 commit 2026-11-23 20:15:15 +00:00
Merge branch 'main' into ci/refuse-claude-md-any-case
Build / build (pull_request) Successful in 14s
Molecule / molecule (pull_request) Successful in 14m37s
Lint / lint (pull_request) Successful in 1m46s
5abf42c6c4
Defame1297 approved these changes 2026-11-23 20:16:53 +00:00
Defame1297 scheduled this pull request to auto merge when all checks succeed 2026-11-23 20:17:19 +00:00
Defame1297 merged commit 567c3d2f22 into main 2026-11-23 20:33:04 +00:00
Defame1297 deleted branch ci/refuse-claude-md-any-case 2026-11-23 20:33:04 +00:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mortis/Kamino#333