diff --git a/action.yaml b/action.yaml index fad2dfa..6af441b 100644 --- a/action.yaml +++ b/action.yaml @@ -68,11 +68,19 @@ runs: # install python. PYTHON_BIN=$(command -v python || true) echo "PYTHON_BIN=$PYTHON_BIN" >> $GITHUB_ENV + + # Finding node + # Skip setup-node when the runner image already has node, so + # pre-commit's baked hook environments (keyed on the system node + # path) are not invalidated by a different node landing on PATH. + NODE_BIN=$(command -v node || true) + echo "NODE_BIN=$NODE_BIN" >> $GITHUB_ENV - name: Setup python # Only run this if we don't already have a pre-commit on the PATH if: env.PYTHON_BIN == null && env.PRE_COMMIT_BIN == null && steps.pre-commit-config.outputs.exists != 'false' uses: actions/setup-python@v6 - name: Determine node version + if: env.NODE_BIN == '' id: node-version shell: bash run: | @@ -88,13 +96,14 @@ runs: echo "version=24" >> $GITHUB_OUTPUT fi - name: Setup node + if: env.NODE_BIN == '' uses: actions/setup-node@v6 with: node-version: ${{ steps.node-version.outputs.version }} - name: Commitlint # This version needs to be sync'd with the repo HEAD if a major version is cut if: inputs.disable-commitlint != 'true' - uses: open-turo/action-pre-commit/commitlint@v3 + uses: open-turo/action-pre-commit/commitlint@f/devex-907_make_setup-node_conditional_in_action-pre-commit_to_preserve_baked_pre-c with: restore-config: "false" config-file: ${{ inputs.config-file }}