From c6ee596cbd5abafc7c734de43b908405878ddac3 Mon Sep 17 00:00:00 2001 From: Shawn Wallis Date: Sat, 10 Apr 2021 14:44:09 -0400 Subject: [PATCH] fix: pipeline workflow pre-commit step --- .github/workflows/pipeline.yaml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pipeline.yaml b/.github/workflows/pipeline.yaml index ead32b4..075f016 100644 --- a/.github/workflows/pipeline.yaml +++ b/.github/workflows/pipeline.yaml @@ -23,6 +23,11 @@ jobs: - name: Checkout Code uses: actions/checkout@v2 + - name: Checkout master and PR branch + run: | + git fetch --no-tags --depth=1 origin +refs/heads/${{ github.base_ref }} + git fetch --no-tags --depth=1 origin ${{ github.sha }} + - name: Setup Python uses: actions/setup-python@v2 with: @@ -53,9 +58,7 @@ jobs: - name: Run pre-commit if: github.event_name == 'pull_request' - run: | - git fetch origin master:master - poetry run pre-commit run --from-ref master --to-ref HEAD + run: poetry run pre-commit run --show-diff-on-failure --files $(git diff --name-only --no-ext-diff -z origin/master..HEAD) test: name: 🧪