From 726152aa7be91ab6830e8e976ea5be0dd35b51f9 Mon Sep 17 00:00:00 2001 From: Aly Raffauf Date: Wed, 3 Jul 2024 21:34:19 -0400 Subject: [PATCH] github: use built-in committing for input updates --- .github/workflows/flake-checks.yml | 2 +- .github/workflows/flake-update-inputs.yml | 25 +++++++++++------------ 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/.github/workflows/flake-checks.yml b/.github/workflows/flake-checks.yml index 8628d7fd..c7f217db 100644 --- a/.github/workflows/flake-checks.yml +++ b/.github/workflows/flake-checks.yml @@ -6,7 +6,7 @@ jobs: steps: - uses: actions/checkout@v3 with: - fetch-depth: 0 + fetch-depth: 1 - uses: cachix/install-nix-action@v20 - name: check if flake complies with default style run: nix fmt -- -c . diff --git a/.github/workflows/flake-update-inputs.yml b/.github/workflows/flake-update-inputs.yml index 3df914c5..5188f09b 100644 --- a/.github/workflows/flake-update-inputs.yml +++ b/.github/workflows/flake-update-inputs.yml @@ -9,20 +9,19 @@ jobs: steps: - uses: actions/checkout@v3 with: + ref: ${{ github.head_ref }} fetch-depth: 1 + - name: "git: setup" + run: | + git config --local user.email "github-actions[bot]@users.noreply.github.com" + git config --local user.name "github-actions[bot]" - uses: cachix/install-nix-action@v20 - - name: update inputs in flake.lock - run: nix flake update - - name: check if flake evaluates + - name: "flake: update inputs" + run: nix flake update --commit-lock-file + - name: "flake: check eval" run: nix flake check - - uses: stefanzweifel/git-auto-commit-action@v5 + - name: "git: push changes" + uses: ad-m/github-push-action@master with: - commit_message: "flake: update inputs" - branch: master - commit_options: '--no-verify --signoff' - file_pattern: flake.lock - commit_user_name: Flake Bot # defaults to "GitHub Actions" - #commit_user_email: my-github-actions-bot@example.org # defaults to "actions@github.com" - commit_author: Flake Bot # defaults to author of the commit that triggered the run - skip_dirty_check: false - skip_fetch: true + branch: ${{ github.head_ref }} +