Description
GitHub Actions are somewhat limited in what paths can be used in which tasks.
With run:
steps, it's possible to set a custom working directory with the working-directory option, but this is not supported for uses:
steps.
The only ways to make a custom container run in a subtree of a checkout are
- with custom container options (which the container must support in some way)
- by manually moving all relevant files from the checkout to the root of the workspace
Neither option is very convenient (and sometimes even impossible) or robust.
One possible solution to this problem could be to support working-directory
in uses:
steps, or the checkout
action could support checking out only a subtree of a repository.
This can be implemented with git write-tree
and git read-tree -um
, as described here: https://stackoverflow.com/questions/30239659/git-clone-only-a-subdirectory-at-the-root-of-the-current-directory/30244250#30244250
Or a sparse checkout could be done and the contents of the subtree moved to the root of the working directory.
Note that this is the opposite of the path:
option of the checkout
action.