From d4d23569bd478d3b0905b4a751741d704eb430a7 Mon Sep 17 00:00:00 2001 From: Tommaso Tarchi Date: Fri, 3 Jul 2026 09:17:59 +0200 Subject: [PATCH 1/3] install pre-commit, add all files (also hidden) For testing the deployment is done on sync-test branch --- .github/workflows/sync-template.yml | 9 ++++++--- hooks/post_gen_project.py | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/sync-template.yml b/.github/workflows/sync-template.yml index 9398278..6c76b6b 100644 --- a/.github/workflows/sync-template.yml +++ b/.github/workflows/sync-template.yml @@ -3,7 +3,7 @@ name: Sync template repository on: push: branches: - - main + - sync-project-template workflow_dispatch: inputs: sync: @@ -22,6 +22,9 @@ jobs: with: path: cookiecutter-repository + - name: Install pre-commit + run: pip install pre-commit + - name: Install cookiecutter run: pip install cookiecutter @@ -45,7 +48,7 @@ jobs: uses: actions/checkout@v6 with: repository: ssciwr/python-project-template - ref: main + ref: sync-test path: target-repository ssh-key: ${{ secrets.SSCIWR_PYTHON_PROJECT_TEMPLATE_DEPLOY_KEY }} @@ -72,4 +75,4 @@ jobs: git commit -m "Sync from ssciwr/cookiecutter-python-project" || echo "No changes" echo "Pushing changes to target repository..." - git push origin main + git push origin sync-test diff --git a/hooks/post_gen_project.py b/hooks/post_gen_project.py index ebe91e2..1231012 100644 --- a/hooks/post_gen_project.py +++ b/hooks/post_gen_project.py @@ -24,12 +24,12 @@ def __enter__(self): def __exit__(self, exc_type, exc_val, exc_tb): # Finalize by making an initial git commit - subprocess.check_call("git add *".split()) + subprocess.check_call(["git", "add", "-A"]) # Maybe run pre-commit if {{ have_precommit }}: subprocess.call("pre-commit run -a".split()) - subprocess.check_call("git add *".split()) + subprocess.check_call(["git", "add", "-A"]) subprocess.check_call(["git", "commit", "-m", "Initial Commit"]) subprocess.check_call(["git", "tag", "v0.0.1"]) From 7f38932661c7db0b89c2d3b6599cc58b5c71c603 Mon Sep 17 00:00:00 2001 From: Tommaso Tarchi Date: Fri, 3 Jul 2026 09:39:44 +0200 Subject: [PATCH 2/3] fix test branch --- .github/workflows/sync-template.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sync-template.yml b/.github/workflows/sync-template.yml index 6c76b6b..bc95bea 100644 --- a/.github/workflows/sync-template.yml +++ b/.github/workflows/sync-template.yml @@ -3,7 +3,7 @@ name: Sync template repository on: push: branches: - - sync-project-template + - fix-pre-commit-config-generation workflow_dispatch: inputs: sync: From b64e1b9321cb4c4d12a71ccc97f9fd7152c6b1fd Mon Sep 17 00:00:00 2001 From: Tommaso Tarchi Date: Fri, 3 Jul 2026 09:42:48 +0200 Subject: [PATCH 3/3] revert to main-to-main sync --- .github/workflows/sync-template.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/sync-template.yml b/.github/workflows/sync-template.yml index bc95bea..a5c48e8 100644 --- a/.github/workflows/sync-template.yml +++ b/.github/workflows/sync-template.yml @@ -3,7 +3,7 @@ name: Sync template repository on: push: branches: - - fix-pre-commit-config-generation + - main workflow_dispatch: inputs: sync: @@ -48,7 +48,7 @@ jobs: uses: actions/checkout@v6 with: repository: ssciwr/python-project-template - ref: sync-test + ref: main path: target-repository ssh-key: ${{ secrets.SSCIWR_PYTHON_PROJECT_TEMPLATE_DEPLOY_KEY }} @@ -75,4 +75,4 @@ jobs: git commit -m "Sync from ssciwr/cookiecutter-python-project" || echo "No changes" echo "Pushing changes to target repository..." - git push origin sync-test + git push origin main