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 exclude directories option #101

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Add exclude directories option #101

wants to merge 2 commits into from

Conversation

pavletto
Copy link

@pavletto pavletto commented May 3, 2023

Hello. I want to thank you for this useful action. I'm trying to use it to create website github pages for our project.

While working on it, I encountered that when I try to update the repository root, some directories that I also created with this action get overwritten (similar to the problem in this issue).

So I added the ability to select which directories to exclude from the rewriting process with the exclude-directories parameter.I do this with the git restore command

I also added removing .git directories from nested directories, because if you don't, they will look like git submodules. You may have done this in some special way, and I should do it some other way.

I hope these changes will be helpful

@cpina
Copy link
Owner

cpina commented May 7, 2023

Hi @pavletto

Thanks for the PR!

Question: could you achieve the same using this other approach? 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

@pavletto
Copy link
Author

Case in FAQ actural for overriding folders in source repository. But my case - overriding in destination repo by other github-action-push-to-another-repository. I have 3 repo and your action build all content after building in one destination. But one of that has target (target-directory: .) on root and action from this repo override another targets in destination repo. and changes in my pr help to prevent that.

@Svaught598
Copy link

Svaught598 commented Jul 16, 2023

@cpina I'm facing this same issue and this would solve it for me. Are there any issues with this PR that I could help out with?

edit: Not sure if it helps, but I setup my actions to run pavletto/github-action-push-to-another-repository@test in my build action with the new exclude-directories argument, and everything is working swimmingly. That said, I'd love to switch back over to this action. I really appreciate all of the work you've done here, and if there is any way I could help contribute, please let me know!

@@ -54,6 +54,10 @@ inputs:
[Optional] create target branch if not exist. Defaults to `false`
default: false
required: false
exclude-directories:
description: '[Optional] The directory to exclude for remove from remote repo'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could probably be changed to say something like

ignore-directories:
  description: '[Optional] whitespace delimited set of directories to ignore.'

It feels like a different naming makes it more obvious that the directories will be ignored in the overall process.

@alexbowers
Copy link

I had a similar issue where I wanted to exclude a lot. The workaround I used in the end was to simply use a .gitignore in the destination repository. This keeps it within standard tooling

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.

4 participants