diff --git a/CHANGELOG.md b/CHANGELOG.md index 3344dd76..0d06664a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning]. - New question: AddPrecommit to add pre-commit related files (#231) - New question: AddGitHubTemplates to add issue and PR templates (#233) - New question: AnswerStrategy to choose between using recommended, minimum, or ask every question (#235) +- New question: AddCopierCI to add Copier.yml (#237) ### Changed diff --git a/copier.yml b/copier.yml index f0efcb02..d5e0879c 100644 --- a/copier.yml +++ b/copier.yml @@ -92,6 +92,12 @@ UseCirrusCI: help: Add CirrusCI to run the package tests on FreeBSD? default: false +AddCopierCI: + when: "{{ AnswerStrategy == 'ask' }}" + type: bool + help: Add workflow to check for template updates? (This is a work in progress workflow that checks whether there has been an update to the template and automatically create a pull request) + default: false + # General AddAllcontributors: when: "{{ AnswerStrategy == 'ask' }}" diff --git a/docs/src/10-full-guide.md b/docs/src/10-full-guide.md index 906dc3d6..468b4a79 100644 --- a/docs/src/10-full-guide.md +++ b/docs/src/10-full-guide.md @@ -196,6 +196,10 @@ The next time that the tests are run, the coverage page will be updated, and the ### Add key for Copier.yml workflow (or delete it) +!!! warning "Copier.yml is work in progress" + This option is not selected by default because it is a work in progress. + If you want to use it, you have to pass the key `"AddCopierCI" => true` to the `data` argument of `generate`, or select "Ask me" when deciding how to answer the optional questions. + You can reapply the template in the future. This is normally a manual job, specially because normally there are conflicts. That being said, we are experimenting with having a workflow that automatically checks whether there are updates to the template and reapplies it. A Pull Request is created with the result. diff --git a/template/.github/workflows/{% if AddPrecommit %}Copier.yml{% endif %}.jinja b/template/.github/workflows/{% if AddCopierCI %}Copier.yml{% endif %}.jinja similarity index 100% rename from template/.github/workflows/{% if AddPrecommit %}Copier.yml{% endif %}.jinja rename to template/.github/workflows/{% if AddCopierCI %}Copier.yml{% endif %}.jinja diff --git a/template/.github/workflows/{% if AddPrecommit %}PreCommitUpdate.yml{% endif %}.jinja b/template/.github/workflows/{% if AddPrecommit %}PreCommitUpdate.yml{% endif %}.jinja index 2c6d1ff9..4cd1a2cd 100644 --- a/template/.github/workflows/{% if AddPrecommit %}PreCommitUpdate.yml{% endif %}.jinja +++ b/template/.github/workflows/{% if AddPrecommit %}PreCommitUpdate.yml{% endif %}.jinja @@ -6,7 +6,7 @@ on: workflow_dispatch: jobs: - Copier: + pre-commit-update: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/test/runtests.jl b/test/runtests.jl index 408105d4..87f82745 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -47,6 +47,7 @@ template_options = Dict( "AddPrecommit" => true, "AddGitHubTemplates" => true, "AnswerStrategy" => "ask", + "AddCopierCI" => false, ) function test_diff_dir(dir1, dir2)