From 4f978e617369a0ff85f60b06570151cc640374b3 Mon Sep 17 00:00:00 2001 From: seth Date: Tue, 21 May 2024 16:07:44 -0600 Subject: [PATCH] ci: don't use graphql to commit (#188) * ci: don't use graphql to commit * style: force reformatting of dev/flake.nix --- .github/workflows/ci.yml | 19 ++++++++++++------- dev/flake.nix | 39 ++++++++++++++++++--------------------- 2 files changed, 30 insertions(+), 28 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4264deb..b02eb3b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,6 +25,13 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 + with: + token: ${{ secrets.PUSH_TOKEN }} + + - name: Set Git user info + run: | + git config user.name 'github-actions[bot]' + git config user.email 'github-actions[bot]@users.noreply.github.com' - name: Get short revision id: rev @@ -41,13 +48,11 @@ jobs: 'nixpkgs#nixfmt-rfc-style' -- . - name: Commit changes - env: - GITHUB_TOKEN: ${{ secrets.PUSH_TOKEN }} - uses: planetscale/ghcommit-action@v0.1.39 - with: - commit_message: "style: format ${{ steps.rev.outputs.rev }}" - repo: "${{ github.repository }}" - branch: "${{ github.head_ref || github.ref_name }}" + run: | + if ! git diff --color=always --exit-code; then + git commit -am "style: format ${{ steps.rev.outputs.rev }}" + git push + fi validate-sources: name: Validate sources diff --git a/dev/flake.nix b/dev/flake.nix index f00b1d2..8e593a3 100644 --- a/dev/flake.nix +++ b/dev/flake.nix @@ -17,12 +17,12 @@ }; outputs = - { - self, - nixpkgs, - nixpkgs-stable, - home-manager, - home-manager-stable, + { self + , nixpkgs + , nixpkgs-stable + , home-manager + , home-manager-stable + , }: let systems = [ @@ -41,11 +41,10 @@ in { apps = forAllSystems ( - { - lib, - pkgs, - system, - ... + { lib + , pkgs + , system + , ... }: { add-source = { @@ -73,11 +72,10 @@ ); checks = forAllSystems ( - { - lib, - pkgs, - system, - ... + { lib + , pkgs + , system + , ... }: lib.optionalAttrs pkgs.stdenv.isLinux { module-test-unstable = pkgs.callPackage ../test.nix { inherit home-manager; }; @@ -90,11 +88,10 @@ formatter = forAllSystems (pkgs: pkgs.nixfmt-rfc-style); packages = forAllSystems ( - { - lib, - pkgs, - system, - ... + { lib + , pkgs + , system + , ... }: let version = self.shortRev or self.dirtyShortRev or "unknown";