From 9fe7e9c9bab44c58d249fece8ac8a64f7cef00d2 Mon Sep 17 00:00:00 2001 From: Piotr Semenov Date: Mon, 15 Apr 2024 20:15:15 +0400 Subject: [PATCH] fix: auto-commit only from syntaxes/ --- .github/workflows/flake.yml | 16 +++++++++++++--- .github/workflows/pre-commit.yml | 11 ++++++++++- Vagrantfile | 2 +- 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/.github/workflows/flake.yml b/.github/workflows/flake.yml index 3745ccd..dde449f 100644 --- a/.github/workflows/flake.yml +++ b/.github/workflows/flake.yml @@ -26,15 +26,25 @@ jobs: run: vagrant --version - name: Run vagrant up & provision - run: VER=23.11 vagrant up --provision + run: vagrant up --provision + env: + VER: 23.11 + + - name: Import GPG key + uses: crazy-max/ghaction-import-gpg@v6.1.0 + with: + gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} + passphrase: ${{ secrets.PASSPHRASE }} - name: Auto-commit changes + id: auto-commit-action uses: stefanzweifel/git-auto-commit-action@v5.0.1 with: - commit_message: Automated Change + commit_message: auto-commit of artifacts branch: main commit_options: '--no-verify --signoff' - commit_user_name: Publishing Bot + file_pattern: 'syntaxes/*' + commit_user_name: publishing-bot commit_user_email: publishing-bot@users.noreply.github.com - name: Run if changes have been detected diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index ea1cce3..a9d1971 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -8,7 +8,7 @@ on: jobs: pre-commit: - runs-on: ubuntu-latest + runs-on: macos-12 steps: - name: checkout uses: actions/checkout@v3 @@ -21,3 +21,12 @@ jobs: - uses: pre-commit/action@v3.0.1 with: extra_args: --files ${{ steps.file_changes.outputs.files }} --show-diff-on-failure + + - name: Show pre-commit logs + if: failure() + run: | + find ~/.cache/pre-commit/ -type f -iname ".pre-commit-hooks.yaml" -exec cat {} \; + cat ~/.cache/pre-commit/pre-commit.log + + - name: Show pre-commit version + run: pre-commit --version diff --git a/Vagrantfile b/Vagrantfile index 4e19906..75fdff7 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -18,7 +18,7 @@ Vagrant.configure("2") do |config| cd /vagrant/ echo "statix check &&\ nix flake check --impure &&\ - cp -r \$(nix build --impure --no-link --print-out-paths) ./syntaxes/" |\ + cp \$(nix build --impure --no-link --print-out-paths)/* ./syntaxes/" |\ nix-shell --run bash SHELL end