From a2613e604806d88f96605ba91b114ab445727ec4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Tue, 30 Apr 2024 11:04:32 +0200 Subject: [PATCH] Fix pre-commit patch --- .github/workflows/main.yaml | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index aa425f4bfd..c3fea43aff 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -46,6 +46,25 @@ jobs: github-gopass-ci-token: ${{secrets.GOPASS_CI_GITHUB_TOKEN}} patterns: docker if: env.HAS_SECRETS == 'HAS_SECRETS' + + - uses: actions/cache@v4 + with: + path: ~/.cache/pre-commit + key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }} + restore-keys: "pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}\npre-commit-" + - run: pre-commit run --all-files + - run: git diff --exit-code --patch > /tmp/pre-commit.patch || true + if: failure() + - uses: actions/upload-artifact@v4 + with: + name: Apply pre-commit fix.patch + path: /tmp/pre-commit.patch + retention-days: 1 + if: failure() + + - name: Print environment information + run: c2cciutils-env + - run: gpg --export-secret-keys --armor D121AF2DFA8E140688BD968930C9B913FD42EF13 > CI.asc if: env.HAS_SECRETS == 'HAS_SECRETS' @@ -80,23 +99,6 @@ jobs: - run: echo "${HOME}/.local/bin" >> ${GITHUB_PATH} - run: python3 -m pip install --user --requirement=ci/requirements.txt - - uses: actions/cache@v4 - with: - path: ~/.cache/pre-commit - key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }} - restore-keys: "pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}\npre-commit-" - - run: pre-commit run --all-files - - run: git diff --exit-code --patch > /tmp/pre-commit.patch || true - if: failure() - - uses: actions/upload-artifact@v4 - with: - name: Apply pre-commit fix.patch - path: /tmp/pre-commit.patch - retention-days: 1 - if: failure() - - name: Print environment information - run: c2cciutils-env - - run: make build - run: make checks