ci: auto sync flake.lock
This commit is contained in:
@@ -31,6 +31,7 @@ jobs:
|
|||||||
github_access_token: ${{ secrets.GH_ACCESS_TOKEN }}
|
github_access_token: ${{ secrets.GH_ACCESS_TOKEN }}
|
||||||
nix_path: nixpkgs=channel:nixos-25.11
|
nix_path: nixpkgs=channel:nixos-25.11
|
||||||
- name: Check for update and perform update
|
- name: Check for update and perform update
|
||||||
|
id: checkChanges
|
||||||
run: |
|
run: |
|
||||||
git config user.name gitea-bot
|
git config user.name gitea-bot
|
||||||
git config user.email bot@git.palkoi.net
|
git config user.email bot@git.palkoi.net
|
||||||
@@ -39,13 +40,18 @@ jobs:
|
|||||||
|
|
||||||
tmpfile="$(mktemp)"
|
tmpfile="$(mktemp)"
|
||||||
jq -srM '.[1].nodes.nixpkgs = .[0].nodes.nixpkgs_2|.[1].nodes.nixpkgs_2 = .[0].nodes.nixpkgs_2 | .[1]' ./nix-config/flake.lock flake.lock > "$tmpfile"
|
jq -srM '.[1].nodes.nixpkgs = .[0].nodes.nixpkgs_2|.[1].nodes.nixpkgs_2 = .[0].nodes.nixpkgs_2 | .[1]' ./nix-config/flake.lock flake.lock > "$tmpfile"
|
||||||
|
cat "$tmpfile" > flake.lock
|
||||||
git add flake.lock
|
git add flake.lock
|
||||||
|
if [ -n "$(git diff --cached)" ]; then echo 'CHANGES=y'>>$GITHUB_OUTPUT; else echo 'CHANGES=n'>>$GITHUB_OUTPUT; fi
|
||||||
- name: Build nix flake
|
- name: Build nix flake
|
||||||
|
if: ${{ steps.checkChanges.outputs.CHANGES == 'y' }}
|
||||||
run: |
|
run: |
|
||||||
nix build .
|
nix build .
|
||||||
- name: Check nix flake
|
- name: Check nix flake
|
||||||
|
if: ${{ steps.checkChanges.outputs.CHANGES == 'y' }}
|
||||||
run: nix flake check --all-systems
|
run: nix flake check --all-systems
|
||||||
- name: Commit updates
|
- name: Commit updates
|
||||||
|
if: ${{ steps.checkChanges.outputs.CHANGES == 'y' }}
|
||||||
run: |
|
run: |
|
||||||
git commit --no-gpg-sign -m 'chore(flake): update flake.lock'
|
git commit --no-gpg-sign -m 'chore(flake): update flake.lock'
|
||||||
git push
|
git push
|
||||||
|
|||||||
Reference in New Issue
Block a user