From 836e80ba121c25f23e80a9c01312298f87438b07 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 | 13 ++++++++++++- Vagrantfile | 2 +- 3 files changed, 26 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..240b7ab 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -8,11 +8,20 @@ on: jobs: pre-commit: - runs-on: ubuntu-latest + runs-on: macos-12 steps: + - name: Install pre-commit & yamllint + run: brew install pre-commit yamllint + + - name: Show pre-commit version + run: pre-commit --version + - name: checkout uses: actions/checkout@v3 + - name: Pre-commit autoupdate + run: pre-commit autoupdate && pre-commit clean + - id: file_changes uses: trilom/file-changes-action@v1.2.4 with: @@ -21,3 +30,5 @@ jobs: - uses: pre-commit/action@v3.0.1 with: extra_args: --files ${{ steps.file_changes.outputs.files }} --show-diff-on-failure + env: + PRE_COMMIT_VERBOSE: 1 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