adafruit / cookiecutter-adafruit-circuitpython

Cookiecutter template for Adafruit's CircuitPython libraries.
MIT License
22 stars 37 forks source link

Copy GitHub Actions Workflows Without Parsing Them #58

Closed sommersoft closed 4 years ago

sommersoft commented 4 years ago

In Discord, wallarug reported the following cookiecutter error:

wallarug_cookie_failure

The toJson is an expression inside the GitHub Actions workflow, used as such: ${{ toJson(blah) }}.

The Jinja2 parser is reading the {{ }} as a Jinja template expression, and obviously failing to execute it.

This fixes this by copying the workflow files in .github/ without sending them through the Jinja2 parser. I tested this locally, got no errors, and everything was rendered properly.

Uses: _copy_without_render.

I really should've spotted this during the Actions PR review. I may have assumed that the $ would keep Jinja from trying to parse it. 🤷‍♂

tannewt commented 4 years ago

Worked! Thanks!