repo-file-sync-action icon indicating copy to clipboard operation
repo-file-sync-action copied to clipboard

Template rendering doesn't work alongside `dest`

Open dalebradman opened this issue 2 years ago • 1 comments

🐞 Describe the bug

It seems as though when you want to use the Jinja templating, you cannot specify the dest keyword in the config alongside template

📚 To reproduce

Set the sync.yml file to:

project/repo_1:
  - source: folder/file.py
    dest: file.py
    template:
      name: dale

Then the file.py file will incorrectly be rendered as:

name = {{ name }}

💡 Expected behavior

I'd like to set the sync.yml file as:

project/repo_1:
  - source: folder/file.py
    dest: another_folder/file.py
    template:
      name: dale

Which will be rendered as:

name = dale

This file will live in another_folder/file.py in the destination repo. Currently, if you remove dest from the config, then it will render the output correctly, however it will sync it to the wrong path in the destination repo.

🖼️ Screenshots

No response

⚙️ Environment

v1

📋 Additional context

This does work for a non-python example:

project/repo_1:
  - source: folder/file.yml
    dest: another_folder/file.yml
    template:
      name: dale

dalebradman avatar Feb 14 '23 14:02 dalebradman

Actually, I'm not 100% sure if the Python file is related to the issue. It might be more of a case that it doesn't work well with multiple sources:

project/repo_1:
  - source: folder/file_1.yml
    dest: another_folder/file_1.yml
    template:
      name: dale
  - source: folder/file_2.yml
    template:
      name: dale

file_2.yml renders and syncs correctly but file_1.yml does not.

dalebradman avatar Feb 14 '23 15:02 dalebradman