diff --git a/.github/workflows/create_cache.yml b/.github/workflows/create_cache.yml index 82f94a3a..ccf4b2bd 100644 --- a/.github/workflows/create_cache.yml +++ b/.github/workflows/create_cache.yml @@ -9,6 +9,16 @@ name: "Create GHA cache" # branch (which is where almost all PRs merge into). on: + workflow_call: # when called from a downstream repo + inputs: + # GHA doesn't seem to provide a simple way to detect workflow_call events + # so we are using an extra input (which is only available when this workflow + # is called from another workflow) with a default value (such that we don't + # have to set it every time) + external-call: + type: boolean + default: true + required: false push: branches: [develop] @@ -20,6 +30,8 @@ concurrency: jobs: # GitHub Actions cache of the pre-commit environment pre-commit: + # downstream repos have their own pre-commit environment + if: ${{ !inputs.external-call }} runs-on: ubuntu-latest steps: - name: Checkout repository