Split action internals into dedicated modules#79
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors the GitHub Action’s internal logic into focused modules and switches prek version resolution to a bundled, checked-in release manifest (including SHA-256 verification of downloaded archives) to avoid runtime GitHub API dependency.
Changes:
- Split prior
shared.tsimplementation intoinputs,manifest,install,cache, andprekmodules and re-export viashared.ts. - Add bundled
src/version-manifest.jsonand resolvelatest/ semver ranges from it at runtime. - Verify downloaded prek archives against manifest-provided SHA-256 digests before extraction/caching.
Reviewed changes
Copilot reviewed 9 out of 15 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| tsconfig.test.json | Include *.d.ts files in test compilation. |
| tsconfig.json | Enable JSON imports (resolveJsonModule) and include *.d.ts in build. |
| src/types.ts | Add shared constants and types for inputs and manifest structures. |
| src/shared.ts | Convert to a re-export façade over the new modules. |
| src/semver.d.ts | Add a local module stub for semver typing. |
| src/inputs.ts | Move input parsing logic into a dedicated module. |
| src/manifest.ts | Implement manifest-based version resolution and asset lookup. |
| src/install.ts | Download prek assets from the manifest and verify SHA-256 before install. |
| src/cache.ts | Move prek cache restore/save logic into a dedicated module. |
| src/prek.ts | Move prek run, verbose log output, and cache pruning into a dedicated module. |
| src/version-manifest.json | Add the bundled prek release/asset manifest used for runtime resolution. |
| package.json | Add semver dependency and an update-version-manifest script. |
| package-lock.json | Lockfile updates for the new dependency. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
fdc6f14 to
6d6c9c3
Compare
6d6c9c3 to
ab90fe7
Compare
j178
added a commit
that referenced
this pull request
Mar 15, 2026
## Summary - resolve prek versions and asset URLs from a bundled release manifest - add a scheduled workflow to refresh the manifest and open an update PR - keep semver range parsing and archive checksum verification for later PRs in the stack ## Stack Depends on #79.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stack
Base PR in this stack.