Skip to content

feat: exec-bit, machine-specific-paths, eol-renormalize hygiene actions - #17

Merged
kyle-sexton merged 1 commit into
mainfrom
feat/repo-hygiene-actions
Jun 23, 2026
Merged

kyle-sexton merged 1 commit into
mainfrom
feat/repo-hygiene-actions

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

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

Action Behavior Source
exec-bit Tracked files whose content starts with a shebang (#! at byte 0) must be git index mode 100755. Two-pass git grep --cached + blob-head scan; fails closed on git error. medley ci-status.yml inline exec-bit job
machine-specific-paths Reject Windows/macOS/Linux user-home and repo-checkout absolute paths in tracked files. Placeholders (C:\Users\<user>\, <repo-root>/) allowed. medley check-machine-specific-paths.sh + hardcoded-path-patterns.sh
eol-renormalize Index-level line-ending drift: git add --renormalize then git diff --cached. Read-only (resets index). Driven by the caller's own .gitattributes. medley editorconfig-ci.yml eol-renormalize job

Design notes

  • exec-bit and machine-specific-paths bundle their scripts via $GITHUB_ACTION_PATH (D7); eol-renormalize is a 3-command git sequence, inlined.
  • Config boundary: exec-bit and eol-renormalize are 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 with extensions/exclude as 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.)
  • Open-closed string inputs with behavior-preserving defaults throughout (D4).

Dogfooding

All three run in ci.yml behind the local ci-status gateway. machine-specific-paths passes exclude: ':(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, actionlint clean on ci.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 in plan.md.

🤖 Generated with Claude Code

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]>
@kyle-sexton
kyle-sexton merged commit da704ff into main Jun 23, 2026
1 check passed
@kyle-sexton
kyle-sexton deleted the feat/repo-hygiene-actions branch June 23, 2026 14:39

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

kyle-sexton added a commit that referenced this pull request Jul 16, 2026
## 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.
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.

1 participant