Skip to content

Commit

Permalink
🐛 add a cleanup workflow to new projects.
Browse files Browse the repository at this point in the history
Signed-off-by: Eden Ross Duff, MSc <[email protected]>
  • Loading branch information
rjdbcm authored Jun 12, 2024
1 parent bbed69e commit 5a6c442
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions ozi/render.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,14 @@ def render_ci_files_set_user(env: Environment, target: Path, ci_provider: str) -
except InvalidGitRepositoryError:
ci_user = ''
Path(target, '.github', 'workflows').mkdir(parents=True)
template = env.get_template('github_workflows/ozi.yml.j2')
with open(
Path(target, '.github', 'workflows', 'ozi.yml'),
'w',
encoding='UTF-8',
) as f:
f.write(template.render())
for i in ['ozi.yml', 'cleanup.yml']:
template = env.get_template(f'github_workflows/{i}.j2')
with open(
Path(target, '.github', 'workflows', i),
'w',
encoding='UTF-8',
) as f:
f.write(template.render())
case _: # pragma: no cover
ci_user = ''
return ci_user
Expand Down

0 comments on commit 5a6c442

Please sign in to comment.