From 61d5794b2d82f56868693a1aa14195086ce86e3d Mon Sep 17 00:00:00 2001 From: testvalue Date: Tue, 10 Mar 2026 22:47:55 -0400 Subject: [PATCH] fix(template): uses gitdefaultbranch as filter instead of variable --- cog.toml | 2 +- template/cog.toml.jinja | 2 +- template/prek.toml.jinja | 4 ++-- .../workflows/pr-checks.yaml.jinja | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cog.toml b/cog.toml index 4bf8b9d..7e0c00f 100644 --- a/cog.toml +++ b/cog.toml @@ -3,7 +3,7 @@ # For a reference of possible values: https://docs.cocogitto.io/config/ # A list of glob patterns describing branches on which semver bump are allowed -branch_whitelist = [""] +branch_whitelist = ["main"] # A list of command to run AFTER creating a version. # `` will be interpreted as your target version diff --git a/template/cog.toml.jinja b/template/cog.toml.jinja index 94b1052..736568f 100644 --- a/template/cog.toml.jinja +++ b/template/cog.toml.jinja @@ -3,7 +3,7 @@ # For a reference of possible values: https://docs.cocogitto.io/config/ # A list of glob patterns describing branches on which semver bump are allowed -branch_whitelist = ["{{ gitdefaultbranch }}"] +branch_whitelist = ["{{ _copier_conf.dst_path | realpath | gitdefaultbranch }}"] # A list of command to run AFTER creating a version. # `{{version}}` will be interpreted as your target version diff --git a/template/prek.toml.jinja b/template/prek.toml.jinja index 14db778..065552f 100644 --- a/template/prek.toml.jinja +++ b/template/prek.toml.jinja @@ -55,8 +55,8 @@ priority = 0 [[repos.hooks]] id = "no-commit-to-branch" -name = "Block commits to {{ gitdefaultbranch }}" -args = ["--branch", "{{ gitdefaultbranch }}"] +name = "Block commits to {{ _copier_conf.dst_path | realpath | gitdefaultbranch }}" +args = ["--branch", "{{ _copier_conf.dst_path | realpath | gitdefaultbranch }}"] stages = ["pre-commit", "pre-push"] priority = 0 diff --git a/template/{% if hosting_platform == 'github' %}.github{% endif %}/workflows/pr-checks.yaml.jinja b/template/{% if hosting_platform == 'github' %}.github{% endif %}/workflows/pr-checks.yaml.jinja index d37ef94..d5d46dc 100644 --- a/template/{% if hosting_platform == 'github' %}.github{% endif %}/workflows/pr-checks.yaml.jinja +++ b/template/{% if hosting_platform == 'github' %}.github{% endif %}/workflows/pr-checks.yaml.jinja @@ -3,7 +3,7 @@ name: PR Checks on: pull_request: - branches: [{{ gitdefaultbranch | default("main") }}] + branches: [{{ _copier_conf.dst_path | realpath | gitdefaultbranch }}] concurrency: group: {% raw %}${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}{% endraw %}