From a6f1e6bb073fbe3a963cefa3dba58da287268e73 Mon Sep 17 00:00:00 2001 From: Adam Bovill Date: Mon, 4 Apr 2022 20:53:57 +1200 Subject: [PATCH] fix: ensure that the inputs.config-file file is reset Checks the `inputs.config-file` files back out to ensure there are no new changes before running pre-commit. fixes #16 --- .github/workflows/ci.yaml | 7 +------ action.yaml | 4 ++++ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 89af28f..504ced2 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,10 +1,6 @@ name: "CI" on: pull_request: - push: - branches: - - main - - "releases/*" jobs: lint: @@ -16,7 +12,6 @@ jobs: # test action works running from the graph test: name: Test - needs: [lint] runs-on: ubuntu-latest steps: - name: Checkout @@ -25,9 +20,9 @@ jobs: fetch-depth: 0 - name: Pre-commit uses: ./ + test-pre-installed: name: Test / Pre-commit exists - needs: [lint] runs-on: ubuntu-latest steps: - name: Checkout diff --git a/action.yaml b/action.yaml index d37c1f8..20f11ec 100644 --- a/action.yaml +++ b/action.yaml @@ -49,6 +49,10 @@ runs: env: # This /github/home is the internal Docker mount of $RUNNER_TEMP/_github_home NODE_PATH: /github/home/node_modules + - name: Clear commitlint config changes + shell: bash + run: | + git checkout "${{ inputs.config-file }}" - name: Setup python # Only run this if we don't already have a pre-commit on the PATH if: env.PRE_COMMIT_BIN == null