Repository navigation
feat: exec-bit, machine-specific-paths, eol-renormalize hygiene actions - #17
Conversation
Phase 3 of the CI de-duplication program: three cross-cutting repo-hygiene composite actions lifted from medley's always-on gateway jobs. - exec-bit: tracked files with a shebang (#! at byte 0) must be git index mode 100755. Bundled two-pass git-grep + blob-head scan; fails closed on git error. - machine-specific-paths: reject Windows/macOS/Linux user-home and repo-checkout absolute paths in tracked files. OS-path regex bodies baked in as the check's definition; scope via extensions/exclude inputs. - eol-renormalize: index-level line-ending drift via `git add --renormalize` then `git diff --cached`; driven by the caller's own .gitattributes. Read-only. All three are pure shell/git (no external binary to pin). exec-bit and machine-specific-paths bundle scripts via $GITHUB_ACTION_PATH; eol-renormalize is short enough to inline. All config-light except machine-specific-paths, whose patterns are check-definition (not a per-repo ruleset), so no standards module. Dogfooded in ci.yml behind the local ci-status gateway. Research notes under docs/dedup-program/research/. Phase 3 checkboxes ticked for these three blocks. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d8eb7cbc81
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| local label=$1 pattern=$2 matches | ||
| # `| head -20` caps noise; the `|| true` absorbs git grep's exit 1 (no match) | ||
| # and head's SIGPIPE under pipefail. Empty result => this pattern is clean. | ||
| matches=$(git grep -nIE "$pattern" -- "${scan_paths[@]}" "${excludes[@]}" | head -20 || true) |
There was a problem hiding this comment.
Fail closed when git grep errors
When a caller supplies a malformed extensions/exclude pathspec (for example EXTENSIONS=':(bad)', checked against this script locally), git grep exits fatally for every pattern, but the pipeline-level || true still makes matches empty and the action finishes with “No machine-specific absolute paths detected.” This silently disables the scan for misconfigured consumers instead of failing closed; only the no-match status should be swallowed.
Useful? React with 👍 / 👎.
## Summary WP-13 (Execution Plan: https://claude.ai/code/artifact/1f2e97bf-823a-4221-99df-b36e7a7f2a55). Closes decision #16, confirms #17 as still correctly a no-op (Decisions Log: https://claude.ai/code/artifact/232ecdce-8316-4880-8c0a-dc3c7dcf3a63). Generalizes `melodic-software/provisioning`'s `pr-body.yml` (decisions #58/#59, already built and verified this session) into a shared reusable workflow, mirroring `pr-title.yml`'s own history: a repo-specific implementation first, then a shared workflow other repos call. The ported logic is verbatim from provisioning's proven, working implementation — not rewritten — so behavior is identical: a native closing keyword (`Closes`/`Fixes`/`Resolves #N`, including `owner/repo#N`, or `"No linked issue"`) plus a non-empty `## Related` section, with HTML comments stripped first so an unedited PR template (whose instructional prose lives in comments) fails rather than passing vacuously. `provisioning`'s own `pr-body.yml` caller is untouched — its PR predates this workflow and isn't required to switch; its own file comment already flagged "wiring it into github-iac's ci-gate ruleset is a follow-up (out of scope for this repo)", which is exactly the shared-workflow path this PR opens for every other repo. **Deliberately not done here**, same shape as WP-2's `do-not-merge-gate` sequencing: rolling out per-repo callers (up to 9 `requires-ci` repos) and adding the `pr-issue-linkage / pr-issue-linkage` required check to `github-iac`'s `ci-gate` ruleset. Both need this PR's merge-commit SHA to pin to, and the ruleset entry specifically must not land before every caller exists and reports green, or open PRs across the org block on a check that never runs. Queued as explicit follow-up work. ## Verification - New `.github/scripts/pr-issue-linkage.test.cjs`: extracts the inline `actions/github-script` body (same technique used to verify the equivalent block ported into medley's `issue-labeling.yml` this session) and runs it in a `vm` sandbox against 9 cases: closing-keyword variants (Fixes/Resolves/past-tense/cross-repo), "No linked issue", missing-both failure naming both problems, an empty Related section, an unedited-template-still-fails proof, a commented-out closing keyword not counting, and case-insensitivity. All 9 pass — confirms the ported logic matches the original byte-for-byte in behavior. - `actionlint`: clean. - `markdownlint-cli2`, `lychee --offline`: clean on the README changes. - `typos`: clean on all 3 files. Opened as draft — leaving merge-ready work queued for review rather than merging autonomously.
Phase 3 of the CI de-duplication program (cross-cutting repo hygiene): the first three of four composite actions, lifted from medley's always-on gateway jobs. All pure shell/git (no external binary to pin).
Actions
exec-bit#!at byte 0) must be git index mode100755. Two-passgit grep --cached+ blob-head scan; fails closed on git error.ci-status.ymlinlineexec-bitjobmachine-specific-pathsC:\Users\<user>\,<repo-root>/) allowed.check-machine-specific-paths.sh+hardcoded-path-patterns.sheol-renormalizegit add --renormalizethengit diff --cached. Read-only (resets index). Driven by the caller's own.gitattributes.editorconfig-ci.ymleol-renormalizejobDesign notes
$GITHUB_ACTION_PATH(D7); eol-renormalize is a 3-command git sequence, inlined.exec-bitandeol-renormalizeare config-light (no standards module).machine-specific-paths' OS-path regexes are the check's definition, not a per-repo ruleset, so they're baked-in behavior-preserving defaults withextensions/excludeas open-closed inputs (D4) — also no standards module. (comment-hygiene, the fourth Phase 3 action, does need a standards config module and follows in a separate PR.)Dogfooding
All three run in
ci.ymlbehind the localci-statusgateway.machine-specific-pathspassesexclude: ':(exclude).github/actions/machine-specific-paths/**'to skip its own pattern script (which contains the literal regex bodies) — exactly how medley self-excludes its pattern files.Verified locally (Git Bash): exec-bit green, machine-specific-paths green with self-exclusion, scripts shellcheck-clean,
actionlintclean onci.yml.Not modified
medley is untouched (its cutover is Phase 6). Research notes under
docs/dedup-program/research/; Phase 3 checkboxes ticked for these three blocks inplan.md.🤖 Generated with Claude Code