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

Delete the destination folder before copying files #58

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

Conversation

spleshka
Copy link

@spleshka spleshka commented Mar 1, 2022

Hi,

The issue we faced with the current script is that if the destination input branch has a folder with files and the files being copied to the destination branch don't have some of the files from that folder (which is expected - some files can be removed on purpose), then the files are not being deleted. Our proposed solution is to make sure that the destination is empty before we copy the file(s) there.

@pushkar4
Copy link

I wanted to mention that the reason we are using this action instead of https://github.com/cpina/github-action-push-to-another-repository is because this action does not delete the existing content inside the destination directory.

Our destination repo has a directory filled with yaml files which are monitored by ArgoCD for changes.
New file means new deployment. Changed file means modify the existing deployment and delete file means tear down the deployment.

With this change we will end up tearing down all our existing deployments when trying to deploy a new one by pushing a new file.

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.

2 participants