Skip to content

feat: protect the action scripts outside CI and add an isolated local simulator - #2

Merged
PerryLink merged 4 commits into
mainfrom
ci-integration
Aug 16, 2026
Merged

feat: protect the action scripts outside CI and add an isolated local simulator#2
PerryLink merged 4 commits into
mainfrom
ci-integration

Conversation

@PerryLink

Copy link
Copy Markdown
Owner

What changed

Local-machine protection for the composite action:

  • scripts/action-patch.mjs and scripts/action-post.mjs now refuse to run outside a GitHub Actions runner (RUNNER_TEMP / GITHUB_WORKSPACE missing), so the action can never write profile overlays or reports into unknown local locations.
  • New scripts/local-test.mjs: a fully isolated local simulator that hardcodes DSH_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-scope DSH_HOME) is never read or written - and replays install -> prepare -> headless run -> post from action.yml.
  • Regression tests in test/action-guard.test.ts (4 tests).
  • Local-testing notes in all five READMEs and the changelog.

Verification

  • pnpm exec tsc --noEmit ?
  • pnpm exec vitest run ? 166 passed / 3 skipped (opt-in e2e)
  • pnpm run check:readmes ?
  • Manual dry-run of the simulator confirmed all artifacts land in the temp sandbox and the real dsh home stays untouched.

… 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
@PerryLink PerryLink closed this Aug 16, 2026
@PerryLink PerryLink reopened this Aug 16, 2026
# Conflicts:
#	CHANGELOG.md
#	scripts/action-patch.mjs
#	scripts/action-post.mjs
@PerryLink
PerryLink merged commit 9b914a0 into main Aug 16, 2026
1 check passed
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