-
Notifications
You must be signed in to change notification settings - Fork 29
73 lines (59 loc) · 1.73 KB
/
update-flake.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: "Update Deps"
on:
workflow_dispatch:
push:
branches:
- "main"
paths:
- ".github/workflows/update-flake.yaml"
schedule:
- cron: '31 2 * * 5'
permissions:
contents: write
jobs:
sync-flake:
runs-on: ubuntu-latest
steps:
- uses: DeterminateSystems/nix-installer-action@main
- name: Generate a token
id: generate-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ vars.TRIGGER_APP_ID }}
private-key: ${{ secrets.TRIGGER_APP_SECRET }}
- name: Checkout
uses: actions/checkout@v4
with:
show-progress: false
token: ${{ steps.generate-token.outputs.token }}
- name: Setup Git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git show -s
- name: Update flake
run: |
nix flake update --accept-flake-config
nix flake info --accept-flake-config
- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: latest
run_install: true
- name: Setup Node.js
uses: actions/setup-node@v4
with:
cache: pnpm
node-version: current
- name: Update deps
run: |
pnpm update --recursive
- name: Commit changes
run: |
set +e
# suppress inactive repo update weekly
git log --pretty=format:"%s" -1 HEAD | grep "dep: update at" && exit 0
git add .
git status
git commit -m "dep: update at $(date +'%Y-%m-%dT%H:%M:%S')" || exit 0
git push