STAT-115: Add claude/check-shared-block composite action (STAT-115)
publish.yaml / publish (push) Successful in 4s
publish.yaml / publish (push) Successful in 4s
Claude-Session: https://claude.ai/code/session_01FS9R1ZEc8Vu7hg2PmzqbpP
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
# Check Shared CLAUDE.md Block
|
||||
|
||||
<!-- action-docs-description source="action.yml" -->
|
||||
## Description
|
||||
|
||||
Fails when a repo's shared CLAUDE.md block has drifted from the canonical copy in stat-tackler-infra
|
||||
<!-- action-docs-description source="action.yml" -->
|
||||
|
||||
<!-- action-docs-inputs source="action.yml" -->
|
||||
## Inputs
|
||||
|
||||
| name | description | required | default |
|
||||
| --- | --- | --- | --- |
|
||||
| `TARGET` | <p>Path to the CLAUDE.md file to check</p> | `false` | `CLAUDE.md` |
|
||||
| `CANONICAL_URL` | <p>Raw URL of the canonical shared fragment</p> | `false` | `https://gitea.pixelparasol.com/stat-tackler/stat-tackler-infra/raw/branch/main/docs/CLAUDE.shared.md` |
|
||||
| `GITEA_TOKEN` | <p>Gitea token with read access to stat-tackler-infra, if it is private</p> | `false` | `""` |
|
||||
<!-- action-docs-inputs source="action.yml" -->
|
||||
|
||||
<!-- action-docs-runs source="action.yml" -->
|
||||
## Runs
|
||||
|
||||
This action is a `composite` action.
|
||||
<!-- action-docs-runs source="action.yml" -->
|
||||
|
||||
## Running locally
|
||||
|
||||
The check logic has no dependency on the composite action wrapper beyond
|
||||
`curl`, `awk`, and `diff` on `PATH`. From a repo's root:
|
||||
|
||||
```bash
|
||||
CANONICAL_URL=https://gitea.pixelparasol.com/stat-tackler/stat-tackler-infra/raw/branch/main/docs/CLAUDE.shared.md \
|
||||
TARGET=CLAUDE.md sh -c '
|
||||
extract() { awk "/<!-- SHARED:BEGIN/{f=1} f{print} /SHARED:END -->/{f=0}" "$1"; }
|
||||
tmp=$(mktemp)
|
||||
curl -sfSL "$CANONICAL_URL" -o "$tmp"
|
||||
extract "$tmp" > "$tmp.canon"
|
||||
extract "$TARGET" > "$tmp.mine"
|
||||
diff -u "$tmp.canon" "$tmp.mine" && echo "matches canonical"
|
||||
rm -f "$tmp" "$tmp.canon" "$tmp.mine"
|
||||
'
|
||||
```
|
||||
|
||||
`GITEA_TOKEN` is only needed if `stat-tackler-infra` becomes private; it is
|
||||
otherwise safe to omit.
|
||||
Reference in New Issue
Block a user