-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support checkout of subdirectory into working directory #1430
Comments
+1, would make using actions with monorepos a lot easier. Currently having to use jobs:
eas-preview:
name: EAS preview
runs-on: ubuntu-latest
steps:
# Checkout project code
# Use sparse checkout to only select files in mobile app directory
# Turning off cone mode ensures that files in the project root are not included during checkout
- uses: actions/checkout@v3
with:
sparse-checkout: 'frontend/mobile'
sparse-checkout-cone-mode: false
# This step is needed because expo-github-action does not support paths.
# Therefore all mobile app assets should be moved to the project root.
- name: Move mobile app files to root
run: |
ls -lah
shopt -s dotglob
mv frontend/mobile/* .
rm -rf frontend
ls -lah |
+1, this would be great. |
+1 |
+1 |
2 similar comments
+1 |
+1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 foruses:
steps.The only ways to make a custom container run in a subtree of a checkout are
Neither option is very convenient (and sometimes even impossible) or robust.
One possible solution to this problem could be to support
working-directory
inuses:
steps, or thecheckout
action could support checking out only a subtree of a repository.This can be implemented with
git write-tree
andgit read-tree -um
, as described here: https://stackoverflow.com/questions/30239659/git-clone-only-a-subdirectory-at-the-root-of-the-current-directory/30244250#30244250Or 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 thecheckout
action.The text was updated successfully, but these errors were encountered: