fix: load bundled default includes outside project root - #569
Merged
Conversation
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
Fix
extends: defaultwhen Visor runs from a GitHub Action checkout where the repository root differs from the action bundle path.defaultis a built-in Visor source, so bundledinclude/extendsentries should resolve inside the Visor package/action bundle rather than through project-local config path validation.Root cause
This regressed in
d08f91225371fefd3c65ab9acda2a930c3447d54(RFC: state machine engine (#245)). That commit extracted code-review defaults fromdefaults/visor.yamlintodefaults/code-review.yamland added:The bundled include was then resolved through the generic local config loader. In GitHub Actions, that validates paths against the checked-out project root, e.g.
/home/runner/work/tyk/tyk, so the bundled action path under/home/runner/work/_actions/.../dist/defaults/code-review.yamlwas rejected as path traversal.Changes
include/extendsentries only within the bundled defaults directory.extends: defaultoutside the Visor package root.Verification
Also ran eslint and prettier on the touched files.
Note: the working tree had unrelated failing empty-comment tests from a separate investigation (
tests/frontends/github-frontend.test.ts,tests/unit/raw-output-extraction.test.ts). They are not part of this PR.