aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/update-deps.yml
blob: 6c0adcd48b929c20dfc29dcf0a1674df6ba35d40 (plain)
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
name: Update Dependencies

on:
  workflow_dispatch:
  schedule:
    - cron: "0 0 * * 1"

jobs:
  update-deps:
    runs-on: ubuntu-latest
    permissions:
      contents: write
      pull-requests: write
    steps:
      - uses: actions/checkout@v4

      - uses: cachix/install-nix-action@v31
        with:
          extra_nix_config: "extra-experimental-features = nix-command flakes"

      - name: Update and Hash
        run: |
          npm update
          NEW_HASH=$(nix shell nixpkgs#prefetch-npm-deps -c prefetch-npm-deps package-lock.json)
          sed -i "s|npmDepsHash = ".*"|npmDepsHash = \"$NEW_HASH\";|" flake.nix

      - name: Create Pull Request
        uses: peter-evans/create-pull-request@v6
        with:
          commit-message: "chore(deps): update npm dependencies"
          title: "chore(deps): update dependencies"
          branch: "chore/update-deps"
          delete-branch: true