feat: protect the action scripts outside CI and add an isolated local simulator - #2
Merged
Conversation
…eck gate (v0.6.0)
… READMEs, add the 0.6.0 changelog entry
… simulator - action-patch.mjs / action-post.mjs now refuse to run without RUNNER_TEMP and GITHUB_WORKSPACE, so they can never write profile overlays or reports into unknown local locations (previously a local run fell back to ./dsh-github and inherited the machine-scope DSH_HOME) - new scripts/local-test.mjs replays the composite action locally with DSH_HOME, DSH_PROFILE_DIR, RUNNER_TEMP, and the output dir hardcoded under a fresh temp sandbox (dsh-github-local-*), overriding any inherited DSH_HOME - regression tests in test/action-guard.test.ts; local-testing notes in all five READMEs and the changelog
# Conflicts: # CHANGELOG.md # scripts/action-patch.mjs # scripts/action-post.mjs
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.
What changed
Local-machine protection for the composite action:
scripts/action-patch.mjsandscripts/action-post.mjsnow refuse to run outside a GitHub Actions runner (RUNNER_TEMP/GITHUB_WORKSPACEmissing), so the action can never write profile overlays or reports into unknown local locations.scripts/local-test.mjs: a fully isolated local simulator that hardcodesDSH_HOME,DSH_PROFILE_DIR,RUNNER_TEMP, and the output directory under a fresh%TEMP%/dsh-github-local-*sandbox for every spawned step - the real dsh home (including a machine-scopeDSH_HOME) is never read or written - and replays install -> prepare -> headless run -> post fromaction.yml.test/action-guard.test.ts(4 tests).Verification
pnpm exec tsc --noEmit?pnpm exec vitest run? 166 passed / 3 skipped (opt-in e2e)pnpm run check:readmes?