-
Notifications
You must be signed in to change notification settings - Fork 5
50 lines (38 loc) · 1.23 KB
/
update_deps.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
name: update_deps
on:
workflow_dispatch: #allow manual triggering
schedule:
- cron: "0 4 * * *"
jobs:
update_deps:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/[email protected]
- name: install nix
uses: DeterminateSystems/nix-installer-action@v14
- name: setup git
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
- name: update
run: |
MESSAGE=""
nix flake update --no-warn-dirty --commit-lock-file
if git rev-parse -q HEAD^; then
MESSAGE="$(git -P log --pretty=format:"%s%n%b" -1)"
git reset --soft HEAD^
fi
if NPINS=$(nix run nixpkgs#npins -- -d . update -f | grep -E '[^\(no changes\)]*url.*'); then
MESSAGE="$MESSAGE
npins url updates:
$NPINS"
fi
if [ -z "$MESSAGE" ]; then
exit 0
fi
git add -A
git commit -m "CI update $(date -I)" -m "$MESSAGE"
git push origin HEAD:${{ github.ref_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}