Skip to content
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

Closed

Conversation

TimDaub
Copy link

@TimDaub TimDaub commented Aug 24, 2022

@TimDaub
Copy link
Author

TimDaub commented Aug 24, 2022

I'm happy to report that my branch ran successfully on my repository and preserved the file defined as an input: #77

@cpina
Copy link
Owner

cpina commented Aug 25, 2022

Thanks very much for the MR (and using the action)! Will have a good look soon and comment.

@TimDaub
Copy link
Author

TimDaub commented Aug 30, 2022

I think the option would be more useful if multiple files at once could be excluded. Any ideas? use a grep in regex mode?

@cpina
Copy link
Owner

cpina commented Sep 1, 2022

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:
https://github.com/cpina/push-to-another-repository-deploy-keys-example/blob/filter-files/.github/workflows/ci.yml#L21

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).

@cpina
Copy link
Owner

cpina commented Sep 5, 2022

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[request] ability to push file but keep some files from deleting in the same folder
2 participants