feat: flashlight-mount + flashlight-init-scripts inputs (v2.1.0)#8
Merged
Merged
Conversation
Two additive inputs — no behaviour change when omitted, so v2.1.0
targets full backwards compatibility with v2.0.x consumers.
flashlight-mount ('auto' | 'root' | 'modules' | 'themes', default
'auto'):
- 'auto' keeps the existing composer.json-based detection.
- 'root' mounts the workspace at /var/www/html (custom PrestaShop
build). Follows Flashlight's develop-prestashop reference example.
- 'modules' and 'themes' force those locations regardless of
composer.json, useful when the type field is wrong or absent.
flashlight-init-scripts (path, default ''):
- Optional directory (absolute or relative to the workspace) mounted
read-only at /tmp/init-scripts inside the container. Flashlight
runs every executable file with a shebang, alphabetically, after
the MySQL dump is restored and before nginx starts.
- Path is validated at parse time; a missing / non-directory path
fails fast with a clear error.
Also fixes the withInputs test helper to preserve dashes in env var
keys (@actions/core.getInput('foo-bar') reads INPUT_FOO-BAR, not
INPUT_FOO_BAR); the helper's earlier substitution meant dashed
inputs would have failed to load in tests — hidden until now because
no test verified a dashed input's roundtrip.
52/52 tests pass (was 43); bundle rebuilt.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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
Two additive Flashlight inputs — no behaviour change when omitted, so this ships as v2.1.0 with full backward compat.
flashlight-mount—'auto' | 'root' | 'modules' | 'themes', default'auto'auto— current composer.json-based detection.root— mounts the workspace at/var/www/html:rwfor custom PrestaShop builds (Flashlight's owndevelop-prestashopreference example).modules/themes— force the location regardless of composer.json (useful whentype:is wrong or absent).flashlight-init-scripts— path, default''Optional directory (absolute or relative to the workspace) mounted read-only at
/tmp/init-scripts. Flashlight runs every executable file with a shebang alphabetically, after MySQL dump restore and before nginx starts. Ideal for seeding data, patching config, or wiring in an internal module at boot.Path is validated at parse time; missing directory fails fast with a clear error.
Fix bundled in
The
withInputstest helper was mangling env keys with dashes (INPUT_FLASHLIGHT_MOUNTinstead ofINPUT_FLASHLIGHT-MOUNT).@actions/core.getInput('foo-bar')actually readsINPUT_FOO-BAR. Fixed so dashed inputs are testable (this was hidden until now because no test verified a dashed input's roundtrip).Test plan
npm run lintcleannpm test— 52 tests, 12 suites (was 43). New coverage:mount.ts: root/modules/themes modes + auto behavior preserved.compose-template.ts: init-scripts volume rendered when path provided, absent when not.inputs.ts: mode validation (throws on'nope'), init-scripts pass-through.flashlight-mount: root(follow-up on prestaflow-prestashop or a scratch repo).Rollout
@v2after tag.🤖 Generated with Claude Code