BetaHuhn / repo-file-sync-action

🔄 GitHub Action to keep files like Action workflows or entire directories in sync between multiple repositories.
https://github.com/marketplace/actions/repo-file-sync-action
MIT License
289 stars 84 forks source link

Add support for compiling Jinja-style templates in sync process #271

Closed dhruvkb closed 1 year ago

dhruvkb commented 1 year ago

Sometimes a single file must be synced to different repositories with small differences. This PR allows files to be marked as templates which are then rendered using Nunjucks instead of simply being copied over as-is.

BetaHuhn commented 1 year ago

Hey @dhruvkb, thanks for taking the time to create this PR!

I wanted to add support for templates for a while (https://github.com/BetaHuhn/repo-file-sync-action/discussions/204) but never had the time to work on it so far.

Any specific reasons for going with Nunjucks as the template engine instead of others like mustache, Handlebars or one of the many others?

dhruvkb commented 1 year ago

To be honest, it was largely a subjective choice. I come from a Python background where Jinja is like the gold standard so Nunjucks made sense. If you have a strong preference for an alternative template engine, I think it'll be a small change and I'll be happy to update the PR.

The other alternative I considered was Pug but that seemed very specifically aimed for HTML templates.

dhruvkb commented 1 year ago

@BetaHuhn is something needed from my end to get this PR merged? We'd like to use templates in our repos so we're eagerly looking forward to a release that includes this feature.

BetaHuhn commented 1 year ago

To be honest, it was largely a subjective choice. I come from a Python background where Jinja is like the gold standard so Nunjucks made sense. If you have a strong preference for an alternative template engine...

Makes sense. No strong opinions on my side, was just curious :)

Is something needed from my end to get this PR merged?

@dhruvkb No, was just too busy to actually review the changes. Will take a look now.

BetaHuhnBot commented 1 year ago

:tada: This PR is included in version 1.18.0 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: