Replace checkoutPath variable with sourceRoot/workspacePath variables #610
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.
Merge / deployment checklist
A discussion on #607 made me realise that the variable name
checkoutPathis used for two purposes:This pull request changes the variable name
checkoutPathto beworkspacePathwhen used for resolving paths, andsourceRootwhenever it is used as a CodeQLsource-root.There is a third use of the
checkoutPath. It is passed tocodeqlas--search-pathwhen running a custom query in the repository being analysed. I think this make little sense because it is very unlikely that the root folder of the repository we're analysing (or the workspace path) contains a query pack.@adityasharad The discussion on #607 also made it clear that there is a slight inconsistency between the way the Action and the Runner handle the resolution of relative paths. The Runner resolves them with respect to the
--checkout-pathflag and the Action resolves them against${GITHUB_WORKSPACE}(aka the working directory).To make the Action and the Runner align better, I suggest we deprecate the
--checkout-pathflag and replace it with--source-rootand--working-directory(both optional like--checkout-pathand defaulting to.) . This should match thecodeql cliterminology and in addition makes the Action and the Runner behave more similar.