Skip to content

Commit 6f4e868

Browse files
committed
ci: add scheduled cruft updates
1 parent cd4a995 commit 6f4e868

1 file changed

Lines changed: 48 additions & 0 deletions

File tree

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
name: Cruft Update
3+
4+
"on":
5+
schedule:
6+
- cron: "0 2 * * 1"
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: write
11+
pull-requests: write
12+
13+
jobs:
14+
update:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v5
18+
19+
- uses: actions/setup-python@v5
20+
with:
21+
python-version: "3.12"
22+
23+
- name: Install Cruft
24+
run: pip install cruft
25+
26+
- name: Check for Cruft updates
27+
id: check
28+
shell: bash
29+
run: |
30+
if cruft check; then
31+
echo "has_changes=0" >> "$GITHUB_OUTPUT"
32+
else
33+
echo "has_changes=1" >> "$GITHUB_OUTPUT"
34+
fi
35+
36+
- name: Apply Cruft update
37+
if: steps.check.outputs.has_changes == '1'
38+
run: cruft update --skip-apply-ask --refresh-private-variables
39+
40+
- name: Create pull request
41+
if: steps.check.outputs.has_changes == '1'
42+
uses: peter-evans/create-pull-request@v8
43+
with:
44+
branch: cruft/update
45+
title: "chore: update from Cruft template"
46+
commit-message: "chore: update from Cruft template"
47+
body: "Automated Cruft update from the upstream Cookiecutter template."
48+
delete-branch: true

0 commit comments

Comments
 (0)