Skip to content

Commit

Permalink
cookiecutter: Remove automerge workflow if user indicates the reposit…
Browse files Browse the repository at this point in the history
…ory will have continuous deployment
  • Loading branch information
jpmckinney committed Mar 21, 2024
1 parent f0bb4c9 commit 5762d0c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions cookiecutter-django/cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"application_name": "{{ cookiecutter.project_slug|lower()|replace(' ', '_')|replace('-', '_')|trim() }}",
"python_version": "3.11",
"use_fathom": "y",
"continuous_deployment": "n",
"_copy_without_render": [
".github/workflows/*.yml"
]
Expand Down
6 changes: 6 additions & 0 deletions cookiecutter-django/hooks/post_gen_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,16 @@ def use_fathom(enabled):
os.remove(os.path.join("core", "context_processors.py"))


def continuous_deployment(enabled):
if enabled:
os.remove(os.path.join(".github", "workflows", "automerge.yml"))


def main():
set_secret_key(os.path.join("core", "settings.py"))

use_fathom("{{ cookiecutter.use_fathom }}".lower() == "y")
continuous_deployment("{{ cookiecutter.continuous_deployment }}".lower() == "y")


if __name__ == "__main__":
Expand Down

0 comments on commit 5762d0c

Please sign in to comment.