Skip to content

Commit 451a2c6

Browse files
authored
ci: Add deps updator (#22)
1 parent 4a30665 commit 451a2c6

1 file changed

Lines changed: 44 additions & 0 deletions

File tree

.github/workflows/update-deps.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Update Dependencies
2+
3+
on:
4+
workflow_dispatch:
5+
6+
permissions:
7+
contents: write
8+
pull-requests: write
9+
10+
jobs:
11+
update-deps:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
17+
- name: Setup elan
18+
run: |
19+
curl https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh -sSf | sh -s -- -y
20+
echo "$HOME/.elan/bin" >> "$GITHUB_PATH"
21+
- name: Run lake update
22+
run: lake update
23+
- name: Check for changes
24+
id: check_changes
25+
run: |
26+
if git diff --quiet; then
27+
echo "has_changes=false" >> $GITHUB_OUTPUT
28+
else
29+
echo "has_changes=true" >> $GITHUB_OUTPUT
30+
fi
31+
32+
- name: Commit and create PR
33+
if: steps.check_changes.outputs.has_changes == 'true'
34+
uses: peter-evans/create-pull-request@v8
35+
with:
36+
token: ${{ secrets.GITHUB_TOKEN }}
37+
commit-message: "chore: Update dependencies at $(date +%Y/%m/%d)"
38+
title: "chore: Update dependencies at $(date +%Y/%m/%d)"
39+
branch: "update-deps-$(date +%s)"
40+
delete-branch: true
41+
body: |
42+
Automated dependency updates via `lake update`.
43+
44+
Please review the changes to `lake-manifest.json`.

0 commit comments

Comments
 (0)