Skip to content

Commit 285bb9a

Browse files
authored
Merge branch 'master' into feat/metavar
2 parents df30ebc + 9a5a42e commit 285bb9a

4 files changed

Lines changed: 75 additions & 22 deletions

File tree

.github/dependabot.yml

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ updates:
44
- package-ecosystem: "github-actions"
55
directory: "/"
66
schedule:
7-
interval: "weekly"
7+
interval: "monthly"
88
cooldown:
99
default-days: 7
1010
commit-message:
@@ -21,7 +21,7 @@ updates:
2121
- package-ecosystem: "uv"
2222
directory: "/"
2323
schedule:
24-
interval: "weekly"
24+
interval: "monthly"
2525
cooldown:
2626
default-days: 7
2727
commit-message:
@@ -31,27 +31,10 @@ updates:
3131
dependency-type: "development"
3232
patterns:
3333
- "*"
34-
# pre-commit
35-
- package-ecosystem: "pre-commit"
36-
directory: "/"
37-
schedule:
38-
interval: "weekly"
39-
cooldown:
40-
default-days: 7
41-
commit-message:
42-
prefix:
43-
labels:
44-
- "internal"
45-
- "dependencies"
46-
- "pre-commit"
47-
groups:
48-
pre-commit:
49-
patterns:
50-
- "*"
5134
- package-ecosystem: "docker"
5235
directory: "/scripts/docker"
5336
schedule:
54-
interval: "weekly"
37+
interval: "monthly"
5538
cooldown:
5639
default-days: 7
5740
commit-message:
@@ -63,7 +46,7 @@ updates:
6346
- package-ecosystem: "docker-compose"
6447
directory: "/scripts/docker"
6548
schedule:
66-
interval: "weekly"
49+
interval: "monthly"
6750
cooldown:
6851
default-days: 7
6952
commit-message:
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Bump pre-commit hooks
2+
3+
on:
4+
schedule:
5+
- cron: "0 12 1 * *"
6+
workflow_dispatch:
7+
8+
permissions: {}
9+
10+
jobs:
11+
bump-pre-commit-hooks:
12+
if: github.repository_owner == 'fastapi'
13+
runs-on: ubuntu-latest
14+
timeout-minutes: 10
15+
steps:
16+
- name: Dump GitHub context
17+
env:
18+
GITHUB_CONTEXT: ${{ toJson(github) }}
19+
run: echo "$GITHUB_CONTEXT"
20+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
21+
with:
22+
token: ${{ secrets.TYPER_LATEST_CHANGES }}
23+
persist-credentials: true
24+
- name: Set up Python
25+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
26+
with:
27+
python-version-file: ".python-version"
28+
- name: Setup uv
29+
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
30+
with:
31+
# Before upgrading uv version, make sure astral-sh/setup-uv knows its checksum.
32+
# See: https://github.com/astral-sh/setup-uv/issues/851#issuecomment-4282017837
33+
version: "0.11.18"
34+
cache-dependency-glob: |
35+
pyproject.toml
36+
uv.lock
37+
- name: Bump pre-commit hooks
38+
run: uv run prek auto-update --freeze --cooldown-days 7
39+
- name: Create pull request
40+
env:
41+
GH_TOKEN: ${{ secrets.TYPER_LATEST_CHANGES }}
42+
BASE_BRANCH: ${{ github.event.repository.default_branch }}
43+
run: |
44+
set -euo pipefail
45+
if git diff --quiet; then
46+
echo "No pre-commit hook updates available"
47+
exit 0
48+
fi
49+
git config user.name "github-actions[bot]"
50+
git config user.email "github-actions[bot]@users.noreply.github.com"
51+
branch="bump-pre-commit-hooks"
52+
git switch -C "$branch"
53+
git add .pre-commit-config.yaml
54+
git commit -m "⬆ Bump pre-commit hooks"
55+
git push --force origin "$branch"
56+
if [ -z "$(gh pr list --head "$branch" --state open --json number --jq '.[].number')" ]; then
57+
gh pr create \
58+
--base "$BASE_BRANCH" \
59+
--head "$branch" \
60+
--title "⬆ Bump pre-commit hooks" \
61+
--body "Bump pre-commit hook versions via \`prek auto-update --freeze --cooldown-days 7\`." \
62+
--label internal \
63+
--label dependencies \
64+
--label pre-commit
65+
else
66+
echo "PR for \"$branch\" already open; branch updated in place."
67+
fi

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ repos:
1313
- id: trailing-whitespace
1414

1515
- repo: https://github.com/crate-ci/typos
16-
rev: 37bb98842b0d8c4ffebdb75301a13db0267cef89 # v1.47.2
16+
rev: bee27e3a4fd1ea2111cf90ab89cd076c870fce14 # frozen: v1.48.0
1717
hooks:
1818
- id: typos
1919
args: [--force-exclude]

docs/release-notes.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
### Internal
66

7+
* 🔧 Set Dependabot schedule interval to "monthly". PR [#1873](https://github.com/fastapi/typer/pull/1873) by [@YuriiMotov](https://github.com/YuriiMotov).
8+
* ⬆ Bump pre-commit hooks. PR [#1895](https://github.com/fastapi/typer/pull/1895) by [@tiangolo](https://github.com/tiangolo).
9+
* 👷 Add GH workflow to bump pre-commit hook versions. PR [#1872](https://github.com/fastapi/typer/pull/1872) by [@YuriiMotov](https://github.com/YuriiMotov).
710
* 👷 Fix latest-changes checkout target. PR [#1883](https://github.com/fastapi/typer/pull/1883) by [@tiangolo](https://github.com/tiangolo).
811
* ⬆️ Update issue-manager to 0.8.1. PR [#1880](https://github.com/fastapi/typer/pull/1880) by [@tiangolo](https://github.com/tiangolo).
912
* ⬆ Bump the github-actions group across 1 directory with 8 updates. PR [#1874](https://github.com/fastapi/typer/pull/1874) by [@dependabot[bot]](https://github.com/apps/dependabot).

0 commit comments

Comments
 (0)