From f2a22bb1b13a2a95638a4d4766c92ce4e219ecac Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Wed, 6 Oct 2021 18:24:36 +0530 Subject: [PATCH] upload patch to artifacts if pre-commit fails --- .github/workflows/pre-commit.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 65d5feb68e..7fa71f1e66 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -17,8 +17,8 @@ jobs: - name: Install deps run: | sudo apt-add-repository -y -u ppa:pybricks/ppa - sudo apt-get install -y black gettext uncrustify - pip3 install -r requirements-dev.txt + sudo apt-get install -y gettext uncrustify + pip3 install black polib pyyaml - name: Populate selected submodules run: git submodule update --init extmod/ulab - name: Set PY @@ -28,3 +28,12 @@ jobs: path: ~/.cache/pre-commit key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }} - uses: pre-commit/action@v1.1.0 + - name: Make patch + if: failure() + run: git diff > ~/pre-commit.patch + - name: Upload patch + if: failure() + uses: actions/upload-artifact@v2 + with: + name: patch + path: ~/pre-commit.patch