OCA/oca-addons-repo-template

Add GH actions broken

simahawk opened this issue · 4 comments

I'm getting this error when creating a repo from scratch locally for v13:

    create  .github/workflows/stale.yml
Something went wrong. Removing destination folder.
Traceback (most recent call last):
  File "/home/sorsi/.local/bin/copier", line 8, in <module>
    sys.exit(CopierApp.run())
  File "/home/sorsi/.local/pipx/venvs/copier/lib/python3.6/site-packages/plumbum/cli/application.py", line 577, in run
    inst, retcode = subapp.run(argv, exit=False)
  File "/home/sorsi/.local/pipx/venvs/copier/lib/python3.6/site-packages/plumbum/cli/application.py", line 572, in run
    retcode = inst.main(*tailargs)
  File "/home/sorsi/.local/pipx/venvs/copier/lib/python3.6/site-packages/copier/cli.py", line 38, in _wrapper
    return method(*args, **kwargs)
  File "/home/sorsi/.local/pipx/venvs/copier/lib/python3.6/site-packages/copier/cli.py", line 252, in main
    self.parent._copy(template_src, destination_path)
  File "/home/sorsi/.local/pipx/venvs/copier/lib/python3.6/site-packages/copier/cli.py", line 187, in _copy
    **kwargs,
  File "/home/sorsi/.local/pipx/venvs/copier/lib/python3.6/site-packages/copier/main.py", line 147, in copy
    copy_local(conf=conf)
  File "/home/sorsi/.local/pipx/venvs/copier/lib/python3.6/site-packages/copier/main.py", line 202, in copy_local
    render_file(conf, rel_path, source_path, render, must_skip)
  File "/home/sorsi/.local/pipx/venvs/copier/lib/python3.6/site-packages/copier/main.py", line 394, in render_file
    content = render(src_path)
  File "/home/sorsi/.local/pipx/venvs/copier/lib/python3.6/site-packages/copier/tools.py", line 162, in __call__
    tmpl = self.env.get_template(str(relpath))
  File "/home/sorsi/.local/pipx/venvs/copier/lib/python3.6/site-packages/jinja2/environment.py", line 883, in get_template
    return self._load_template(name, self.make_globals(globals))
  File "/home/sorsi/.local/pipx/venvs/copier/lib/python3.6/site-packages/jinja2/environment.py", line 857, in _load_template
    template = self.loader.load(self, name, globals)
  File "/home/sorsi/.local/pipx/venvs/copier/lib/python3.6/site-packages/jinja2/loaders.py", line 127, in load
    code = environment.compile(source, name, filename)
  File "/home/sorsi/.local/pipx/venvs/copier/lib/python3.6/site-packages/jinja2/environment.py", line 638, in compile
    self.handle_exception(source=source_hint)
  File "/home/sorsi/.local/pipx/venvs/copier/lib/python3.6/site-packages/jinja2/environment.py", line 832, in handle_exception
    reraise(*rewrite_traceback_stack(source=source))
  File "/home/sorsi/.local/pipx/venvs/copier/lib/python3.6/site-packages/jinja2/_compat.py", line 28, in reraise
    raise value.with_traceback(tb)
  File "/tmp/copier.vcs.clone.iu4mhnc1/src/.github/workflows/{% if ci == 'GitHub' %}test.yml{% endif %}.jinja", line 62, in template
jinja2.exceptions.TemplateAssertionError: no filter named 'bool'

but I get the same error when trying to activate GH actions on an existing one.
What's worse is that when running this w/ copier update on the existing one, it nukes the submodule folder.

Jinja2==2.11.2
copier==5.1.0

I can't reproduce (using copier 6.2 installed with pipx).

Interestingly the error shows up in CI: #157. https://github.com/OCA/oca-addons-repo-template/actions/runs/3122023363/jobs/5063694327

I think the solution is to upgrade copier.

yajo commented

Yes, that should do it.

There hasn't been any activity on this issue in the past 6 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this issue to never become stale, please ask a PSC member to apply the "no stale" label.