derberg / manage-files-in-multiple-repositories

GitHub Action that introduces support for global workflows. Global workflows are the one you update in just one repo and they are automatically updated in other repositories.
MIT License
51 stars 18 forks source link

Replicate to other repos only if the file does not already exist #60

Open devantler opened 11 months ago

devantler commented 11 months ago

I have a use case where I want to copy out a default dependabot.yaml file to all my repos, but only if it doesn't already exist. This allows each repo to extend or overwrite the base but simultaneously ensures that all new repos have a minimal dependabot setup configured.

I was not able to find a possibility for this, so I would like to hear if this is something you find useful?

derberg commented 5 months ago

yeah, kinda makes sense

I just for now use repos to ignore flag, so then copying contributor guide, I do it to all repos with some exceptions

any suggestions how the flag should be called?

devantler commented 5 months ago

I was thinking of something in line with a boolean called ignoreExistingFiles. If it is set to true the action will not copy a file that exists, and if not it will have its default behavior :-)

I don't know if this is granular enough, otherwise, it could be a string list called existingFilesToIgnore with file paths to ignore. If an existing file path exists in the target repo it will be ignored. This gives more control to the user at the cost of some complexity.

Either approach would work for me, but I hope it helps :-)