Skip to content

Bump cachix/install-nix-action from 23 to 24 #9

Bump cachix/install-nix-action from 23 to 24

Bump cachix/install-nix-action from 23 to 24 #9

name: Update vendorHash
on: pull_request
permissions:
contents: write
jobs:
dependabot:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Install Nix
uses: cachix/install-nix-action@v24
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
nix_path: nixpkgs=channel:nixos-unstable
- name: Update checksum
run: |
failedbuild=$(nix build --impure --expr "((builtins.getFlake \"$(pwd)#\").packages.\${builtins.currentSystem}.shelly-exporter.override { vendorSha256 = \"\"; })" 2>&1 || true)
checksum=$(echo "$failedbuild" | awk '/got:.*sha256/ { print $2 }')
sed -i -e "s|{ vendorSha256 ? \".*\"|{ vendorSha256 ? \"$checksum\"|" flake.nix
# git push if we have a diff
if [[ -n $(git diff) ]]; then
git add flake.nix
git config --global user.email "<49699333+dependabot[bot]@users.noreply.github.com>"
git config --global user.name "dependabot[bot]"
git commit -m "update vendorHash"
git push origin HEAD:${{ github.head_ref }}
fi