Skip to content

Lock file maintenance #505

Lock file maintenance

Lock file maintenance #505

Workflow file for this run

name: Flake
on: pull_request
permissions:
contents: "read"
pull-requests: "write"
jobs:
lockfile-drv-changed:
runs-on: ubuntu-24.04
steps:
- name: Check changed files
id: changed
run: |
files=$(gh pr diff "$PR_URL" --name-only | xargs -n1 basename | sort -u)
if [ "$files" = "flake.lock" ]; then
echo "only_lock_changed=true" | tee -a "$GITHUB_OUTPUT"
else
echo "only_lock_changed=false" | tee -a "$GITHUB_OUTPUT"
fi
env:
GH_TOKEN: ${{ github.token }}
PR_URL: ${{ github.event.pull_request.html_url }}
- uses: DeterminateSystems/nix-installer-action@main
if: steps.changed.outputs.only_lock_changed == 'true'
with:
extra-conf: |
accept-flake-config = true
- name: Install gh-actions-compare-pr-flake-lockfile
if: steps.changed.outputs.only_lock_changed == 'true'
run: |
nix build github:josh/nixbits#gh-actions-compare-pr-flake-lockfile
readlink -f result/bin >>"$GITHUB_PATH"
rm result
- name: Compare head and base flake packages
if: steps.changed.outputs.only_lock_changed == 'true'
run: gh-actions-compare-pr-flake-lockfile
env:
GH_TOKEN: ${{ github.token }}
PR_URL: ${{ github.event.pull_request.html_url }}
BASE_FLAKE: "github:${{ github.event.pull_request.base.repo.full_name }}/${{ github.event.pull_request.base.sha }}"
HEAD_FLAKE: "github:${{ github.event.pull_request.head.repo.full_name }}/${{ github.event.pull_request.head.sha }}"