Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Update Lock File

Update Lock File #261

name: "Update Lock File"
on:
workflow_dispatch:
concurrency:
group: nixpkgs-flox-update
cancel-in-progress: true
permissions:
contents: write
jobs:
update_inputs:
name: "Update and sync flake.lock"
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
ref: master
# Pushes made by the action token do not trigger additional actions
token: ${{ secrets.NIX_GIT_TOKEN }}
- name: "Install nix"
uses: cachix/install-nix-action@v17
with:
extra_nix_config: |
access-tokens = github.com=${{ secrets.NIX_GIT_TOKEN }}
- name: Git Configure
run: |
git config --global user.name 'Flox Updater'
git config --global user.email '[email protected]'
# TODO: import and use flox?
git config --global url."https://${{ secrets.NIX_GIT_TOKEN }}@github.com".insteadOf ssh://[email protected]
- name: Update Flake
run: |
nix flake update --show-trace -vv
- name: "Commit flake.lock file"
run: |
if [[ $(git diff --exit-code -- flake.lock) ]]; then
git add flake.lock
git commit -m "flake.lock: automatic update"
git push
else
echo '::warning file={flake.lock},title={Lockfile Unchanged}::{Index was updated but the lock file did not change.}'
fi