cargo-generate / cargo-generate-action

GitHub Action to run the cargo-generate tool in order to simplify testing for template authors
5 stars 6 forks source link

`arguments` seems to be not working #20

Open orhun opened 1 month ago

orhun commented 1 month ago

Hello! 👋🏼

I wanted to update cargo-generate-action to 0.20.0 for ratatui-templates repository but I can't seem to get arguments working. I need to --define a couple of values since template_values_file is now removed from the action.

- name: Run cargo generate
  uses: cargo-generate/cargo-generate-action@v0.20.0
  with:
    name: ${{ env.PROJECT_NAME }}
    template: component
    arguments: --define gh-username="ratatui" --define project-description="Example of ratatui template" --define use_gitserver=false

I tried many other formattings (single quote, double quote/escaped) but got this error for each one:

work/templates/templates":"/github/workspace" 3e691b:d11e43af5a53417e89436a999d146440  "--path" "component" "--define gh-username=\"ratatui\" --define project-description=\"Example of ratatui template\" --define use_gitserver=false" "--name" "ratatui-github-example"

error: unexpected argument found

See the PR for more information: https://github.com/ratatui-org/templates/pull/66

As I can tell the GitHub action adds double quotes to the arguments as default which makes them not being processed correctly.

I tried a potential fix here but it didn't work: #19 (nevertheless I think this is good to have)

which makes me think something else is going on here 🤔

orhun commented 1 month ago

Seems like a465b5a8a2a858653627b11130b824af6600b4ab fixes it, it's a little argument parsing issue :/