build-lectures: drop eval, quote path inputs (#36) - #48
Merged
Merged
Conversation
- M10: the build command was assembled by string interpolation and run via `eval $BUILD_CMD`, so a space or shell metachar in source-dir/output-dir could break it. Invoke `jb build` directly with the directories passed via env and quoted, and builder-specific flags in a bash array. No eval. - L17: default `output-dir` `./` -> `.` (drops the `.//_build` double-slash). - L22: `extra-args` is still intentionally word-split (e.g. `-W --keep-going`); documented in the step that quoted args with embedded spaces aren't supported. Behavior preserved (flag order is irrelevant to jb); verified each builder expands to the same command. Closes #36 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR hardens the build-lectures composite action’s shell invocation by removing eval, quoting path inputs, and restructuring builder selection to be safer and more predictable when paths contain spaces or shell metacharacters.
Changes:
- Replaces interpolated
eval $BUILD_CMDwith a directjb buildinvocation using quoted path arguments and abuilder_argsbash array. - Updates the
output-dirdefault from./to.to avoid.//_build/...paths. - Documents (in-step) that
extra-argsis intentionally word-split (unquoted) to allow multiple flags.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
build-lectures/action.yml |
Drops eval, quotes path inputs via env vars, uses an array + case for builder flags, and adjusts output-dir default. |
CHANGELOG.md |
Adds an Unreleased entry describing the shell-safety changes and default tweak. |
- README: output-dir default ./ -> . (matches the action default). - extra-args: document the unquoted/word-split limitation in both the action.yml input description and the README row (user-facing behavior). - build-path: compute once and write via the <<EOF delimiter form (the repo's existing pattern) instead of four duplicated echoes. Co-Authored-By: Claude Opus 4.8 <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.
Closes #36 (M10, L17, L22) — shell-safety cleanup of
build-lectures.M10 — drop
eval, quote the path inputsThe build command was built by string interpolation and run through
eval $BUILD_CMD, so a space or shell metacharacter insource-dir/output-dirwould break the build. Now it invokesjb builddirectly:source-dir/output-dir/builder/extra-argsare passed viaenv:and the paths are quoted.builder_args), so noeval.case.L17 —
output-dirdefault./→.Drops the cosmetic
.//_build/htmldouble-slash in the build path.L22 —
extra-argsword-splitting (documented)$EXTRA_ARGSis left unquoted on purpose so-W --keep-goingsplits into two flags. A comment in the step notes that quoted args with embedded spaces insideextra-argsaren't supported (the standard CI caveat).Verification
bash -nclean on the new logic; noevalremains.jb, and each builder expands to the same command as before, e.g. pdflatex →jb build lectures --path-output . --builder pdflatex -n -W --keep-going.Closes #36
🤖 Generated with Claude Code