-
Notifications
You must be signed in to change notification settings - Fork 299
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
Add target-directory-ignored-file-name #77
Add target-directory-ignored-file-name #77
Conversation
TimDaub
commented
Aug 24, 2022
- Fixes [request] ability to push file but keep some files from deleting in the same folder #58
- I have not tested this yet, but do you agree that it structurally fixes [request] ability to push file but keep some files from deleting in the same folder #58?
- It only supports matching a single file for now
- It should allow files that contain spaces too
I'm happy to report that my branch ran successfully on my repository and preserved the file defined as an input: #77
|
Thanks very much for the MR (and using the action)! Will have a good look soon and comment. |
I think the option would be more useful if multiple files at once could be excluded. Any ideas? use a grep in regex mode? |
Hi @TimDaub , and thanks again for the MR. In other MRs and issues I was trying to avoid adding new options (unless needed, of course). The reason is to avoid regressions (sadly the testing is done manually) and to keep the action more or less small which makes it easier to maintain, make forks, etc. (and yes, I want to add automated tests but I haven't had time). So, my thoughts at the moment, is to use a step before the action step and do the filtering there. I've just wrote an example using rsync: Why using rsync? With the --exclude, --include and --filter (and even --exclude-from and --include-from) it allows doing almost everything. The same could be achieved using rclone, find, etc. whatever the user is more comfortable with (rsync, if combining multiple --exclude, --include, etc. is a bit tricky to use in my opinion). Would that work for you? (seeing the example: https://github.com/cpina/push-to-another-repository-deploy-keys-example/blob/filter-files/.github/workflows/ci.yml#L21) My idea at the moment is to improve the documentation (this is partially done in https://github.com/cpina/github-action-push-to-another-repository/tree/improve-documentation#github-action-push-to-another-repository (I'm proof-reading it, finishing small corrections). When I've finished this the next days add some examples of filtering using rsync in the documentation (I will try to document path matching and file matching). |
I've published the new documentation and there is an example that might work for you: https://cpina.github.io/push-to-another-repository-docs/faq.html#how-can-i-copy-only-some-files-only-some-directories-exclude-some-files-etc I will add more examples / explanations but I think that this is the way to go (keeping this logic outside the action using rsync which has very good filtering code... or other tools). Thanks again for the PR! |