Skip to content

Commit e499619

Browse files
authored
Align template tooling with project standards (#28)
* Update gitleaks permissions * Add Zizmor Badge * Update project dependencies and betterleaks
1 parent 738e365 commit e499619

20 files changed

Lines changed: 226 additions & 210 deletions

‎.github/workflows/template.yml‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,12 @@ jobs:
4343
with:
4444
enable-cache: false
4545
version: ">=0.13,<0.14"
46-
- name: Install just
46+
# Tools the rendered project's ci-lint needs
47+
- name: Install just, actionlint, and yamllint
4748
run: |
48-
uv tool install rust-just
49+
uv tool install rust-just==1.59.0
50+
uv tool install actionlint-py==1.7.12.25
51+
uv tool install yamllint==1.38.0
4952
- name: Render a project and run its checks
5053
run: |
5154
just check

‎README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
[![Template Checks](https://github.com/ahcodedev/python-project-template/actions/workflows/template.yml/badge.svg?branch=main)](https://github.com/ahcodedev/python-project-template/actions/workflows/template.yml)
44
[![Security](https://github.com/ahcodedev/python-project-template/actions/workflows/security.yml/badge.svg?branch=main)](https://github.com/ahcodedev/python-project-template/actions/workflows/security.yml)
5+
[![zizmor](https://img.shields.io/badge/%F0%9F%8C%88-zizmor-white?labelColor=white)](https://zizmor.sh/)
56

67
A [Copier](https://copier.readthedocs.io/) template for Python projects. Projects created from it can pull in later
78
template changes with `copier update`.

‎justfile‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,12 @@ render:
2525
# Install Homebrew tools from the Brewfile
2626
setup:
2727
brew bundle install
28-
# Render a demo project and run its lint, tests, docs build, dependency audit, and workflow audit
28+
# Render a demo project and run its lint, spell check, tests, docs build, dependency audit, and workflow audit
2929
check: render
3030
cd {{ rendered }} && just sync
3131
cd {{ rendered }} && just ci-lint
32-
cd {{ rendered }} && just test
32+
cd {{ rendered }} && uvx typos
33+
cd {{ rendered }} && just coverage
3334
cd {{ rendered }} && just docs-build
3435
cd {{ rendered }} && just audit
3536
cd {{ rendered }} && uvx zizmor --offline .
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"features": {
3+
"ghcr.io/devcontainers/features/github-cli:1": {
4+
"version": "1.1.3",
5+
"resolved": "ghcr.io/devcontainers/features/github-cli@sha256:bd7ab48a832228f633239277552c30b353867fef2e5b037e064b4e64f0b843f2",
6+
"integrity": "sha256:bd7ab48a832228f633239277552c30b353867fef2e5b037e064b4e64f0b843f2"
7+
}
8+
}
9+
}

‎template/.github/dependabot.yml‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,19 @@ updates:
77
- package-ecosystem: "github-actions"
88
directory: "/"
99
schedule:
10-
interval: "monthly"
10+
interval: "weekly"
1111
cooldown:
1212
default-days: 7
1313
labels: ["dependencies"]
1414
groups:
1515
github-actions:
16-
patterns: ["*"]
16+
update-types: ["minor", "patch"]
1717

1818
# Python dependencies in pyproject.toml / uv.lock
1919
- package-ecosystem: "uv"
2020
directory: "/"
2121
schedule:
22-
interval: "monthly"
22+
interval: "weekly"
2323
cooldown:
2424
default-days: 7
2525
labels: ["dependencies"]
@@ -31,7 +31,7 @@ updates:
3131
- package-ecosystem: "docker"
3232
directory: "/.devcontainer"
3333
schedule:
34-
interval: "monthly"
34+
interval: "weekly"
3535
cooldown:
3636
default-days: 7
3737
labels: ["dependencies"]
@@ -40,7 +40,7 @@ updates:
4040
- package-ecosystem: "devcontainers"
4141
directory: "/"
4242
schedule:
43-
interval: "monthly"
43+
interval: "weekly"
4444
cooldown:
4545
default-days: 7
4646
labels: ["dependencies"]

‎template/.github/pull_request_template.md.jinja‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Add a release label to this PR from the Labels section of the PR sidebar
2323
## Checklist
2424

2525
- [ ] `just lint` passes
26-
- [ ] `just test` passes
26+
- [ ] `just coverage` passes
2727
- [ ] Tests added or updated for the change
2828
- [ ] `README.md` updated if needed
2929
{%- if use_releases %}

‎template/.github/workflows/dependabot-auto-merge.yml‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,15 @@ on:
99

1010
permissions: {}
1111

12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
15+
1216
jobs:
1317
auto-merge:
1418
if: github.event.pull_request.user.login == 'dependabot[bot]'
15-
runs-on: ubuntu-slim
19+
runs-on: ubuntu-latest
20+
timeout-minutes: 15
1621
permissions:
1722
contents: write
1823
pull-requests: write

‎template/.github/workflows/python.yml.jinja‎

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,14 @@ on:
99

1010
permissions: {}
1111

12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
15+
1216
jobs:
1317
code-check-and-unit-test:
14-
runs-on: ubuntu-slim
18+
runs-on: ubuntu-latest
19+
timeout-minutes: 15
1520
permissions:
1621
contents: read
1722
steps:
@@ -25,21 +30,26 @@ jobs:
2530
version: ">=0.13,<0.14"
2631
- name: Setup environment
2732
run: |
28-
uv tool install rust-just
33+
uv tool install rust-just==1.59.0
34+
uv tool install actionlint-py==1.7.12.25
35+
uv tool install yamllint==1.38.0
2936
just sync
3037
- name: Lint
3138
run: |
3239
just ci-lint
40+
- name: Spell check
41+
uses: crate-ci/typos@276087d9a4f06398b3e04825487805e2d7375888 # v1.52.2
3342
- name: Unit tests
3443
run: |
35-
just test
44+
just coverage
3645
{%- endraw %}{% if use_docs %}{% raw %}
3746
- name: Docs build
3847
run: |
3948
just docs-build
4049
{%- endraw %}{% endif %}{% raw %}
4150
markdownlint:
42-
runs-on: ubuntu-slim
51+
runs-on: ubuntu-latest
52+
timeout-minutes: 15
4353
permissions:
4454
contents: read
4555
steps:

‎template/.github/workflows/release-drafter.yml‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,15 @@ on:
99
permissions:
1010
contents: read
1111

12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
15+
1216
jobs:
1317
update-draft:
1418
if: github.event_name == 'push'
15-
runs-on: ubuntu-slim
19+
runs-on: ubuntu-latest
20+
timeout-minutes: 15
1621
permissions:
1722
contents: write
1823
steps:
@@ -22,7 +27,8 @@ jobs:
2227

2328
autolabel:
2429
if: github.event_name == 'pull_request' && github.event.action != 'labeled' && github.event.action != 'unlabeled'
25-
runs-on: ubuntu-slim
30+
runs-on: ubuntu-latest
31+
timeout-minutes: 15
2632
permissions:
2733
pull-requests: write
2834
steps:
@@ -37,12 +43,14 @@ jobs:
3743
# Run even when autolabel is skipped (labeled/unlabeled events)
3844
if: ${{ always() && github.event_name == 'pull_request' }}
3945
runs-on: ubuntu-latest
46+
timeout-minutes: 15
4047
permissions:
4148
pull-requests: read
4249
steps:
4350
- uses: mheap/github-action-required-labels@23e10fde7e062233401931a0eece796cd9bf3177 # v5.6.0
4451
with:
4552
mode: minimum
4653
count: 1
54+
# yamllint disable-line rule:line-length
4755
labels: "breaking, feature, enhancement, bug, fix, chore, ci, dependencies, documentation, refactor, skip-changelog"
4856
use_api: true

‎template/.github/workflows/release.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ permissions:
1313
jobs:
1414
release:
1515
runs-on: ubuntu-latest
16+
timeout-minutes: 15
1617
permissions:
1718
contents: write
1819
steps:

0 commit comments

Comments
 (0)