Skip to content

update-flake-lock

update-flake-lock #10

name: update-flake-lock
on:
workflow_dispatch: # allows manual triggering
schedule:
- cron: '0 0 * * 0' # runs weekly on Sunday at 00:00
jobs:
lockfile:
strategy:
matrix:
template:
- ""
- agd
- hask
- iogx
- iogx-plutus
- pix
- pix-ctl
- pix-ctl-full
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Nix
uses: cachix/install-nix-action@V27
with:
extra_nix_config: |
accept-flake-config = true
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- name: Read inputs from flake.nix
id: read_inputs
run: |
[ -n "${{ matrix.template }}" ] && cd ${{ matrix.template }}
inputs=$(nix-instantiate --json --eval --expr 'let inputs = ((import ./flake.nix).inputs or {}); in builtins.attrNames inputs')
echo "inputs=$inputs" >> $GITHUB_OUTPUT
- name: Trigger update-flake-lock-inputs workflow
if: steps.read_inputs.outputs.inputs != '[]'
run: |
curl -f -X POST \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${{ github.repository }}/actions/workflows/update-flake-lock-inputs.yml/dispatches \
-d '{"ref":"main","inputs":{"templates":"[\"${{ matrix.template }}\"]","flake_inputs":${{ toJSON(steps.read_inputs.outputs.inputs) }}}}'