From eb2890525ecd71034cc90fd092db97f7bce4cbc8 Mon Sep 17 00:00:00 2001 From: Pedro Rey Anca Date: Thu, 21 Aug 2025 20:01:48 +0200 Subject: [PATCH] Add workflow to update flake inputs --- .forgejo/workflows/update-flake-inputs.yaml | 45 +++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .forgejo/workflows/update-flake-inputs.yaml diff --git a/.forgejo/workflows/update-flake-inputs.yaml b/.forgejo/workflows/update-flake-inputs.yaml new file mode 100644 index 0000000..1fbce12 --- /dev/null +++ b/.forgejo/workflows/update-flake-inputs.yaml @@ -0,0 +1,45 @@ +name: Update `flake.lock` +on: + workflow_dispatch: + push: + branches: ['main'] + schedule: + - cron: '0 0 * * 6' # runs weekly on Saturday at 00:00 + +jobs: + update_lockfile: + runs-on: docker + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Install nix + uses: https://github.com/DeterminateSystems/nix-installer-action@main + + - name: Install dependencies + run: | + apt-get update && apt-get install jq -y + + - name: Update flake.lock + id: update + run: | + nix flake update 2> >(tee /dev/stderr) | awk ' + /^• Updated input/ {in_update = 1; print; next} + in_update && !/^warning:/ {print} + /^$/ {in_update = 0} + ' > update.log + + echo "UPDATE_LOG<> $GITHUB_ENV + cat update.log >> $GITHUB_ENV + echo "EOF" >> $GITHUB_ENV + + rm update.log + + - name: Create Pull Request + uses: https://github.com/maxking/forgejo-create-pr@main + with: + token: ${{ secrets.FORGEJO_TOKEN }} + base: 'main' + pr-branch: 'flake-update' + commit-message: 'flake.lock: update' + pr-title: 'flake.lock: update' + pr-body: Automated flake update