Skip to content

Commit

Permalink
feat: 🎸 Add AddCopierCI question to add Copier.yml
Browse files Browse the repository at this point in the history
✅ Closes: #237
  • Loading branch information
abelsiqueira committed Jun 7, 2024
1 parent 97bc086 commit 223654f
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 6 additions & 0 deletions copier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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' }}"
Expand Down
6 changes: 5 additions & 1 deletion docs/src/10-full-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,11 @@ Step 2 is not necessary because it is already present in the template.

The next time that the tests are run, the coverage page will be updated, and the badge will be fixed.

### Add key for Copier.yml workflow (or delete it)
### Add key for Copier.yml workflow

!!! 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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
workflow_dispatch:

jobs:
Copier:
pre-commit-update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
1 change: 1 addition & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ template_options = Dict(
"AddPrecommit" => true,
"AddGitHubTemplates" => true,
"AnswerStrategy" => "ask",
"AddCopierCI" => false,
)

function test_diff_dir(dir1, dir2)
Expand Down

0 comments on commit 223654f

Please sign in to comment.