potiuk commented on code in PR #54258:
URL: https://github.com/apache/airflow/pull/54258#discussion_r2273190317


##########
.github/actions/install-prek/action.yml:
##########
@@ -59,36 +54,36 @@ runs:
         rm -rf ~/.cache
         echo
       shell: bash
-    - name: "Restore pre-commit cache"
+    - name: "Restore prek cache"
       uses: 
apache/infrastructure-actions/stash/restore@1c35b5ccf8fba5d4c3fdf25a045ca91aa0cbc468
       with:
-        key: cache-pre-commit-v4-${{ inputs.python-version }}-${{ 
hashFiles('.pre-commit-config.yaml') }}
+        key: cache-prek-v4-${{ inputs.python-version }}-${{ 
hashFiles('.pre-commit-config.yaml') }}
         path: /tmp/
-      id: restore-pre-commit-cache
-    - name: "Check if pre-commit cache tarball exists"
+      id: restore-prek-cache
+    - name: "Check if prek cache tarball exists"
       shell: bash
       run: |
-        if [ -f /tmp/cache-pre-commit.tar.gz ]; then
-          echo "✅ Cache tarball found: /tmp/cache-pre-commit.tar.gz"
+        if [ -f /tmp/cache-prek.tar.gz ]; then
+          echo "✅ Cache tarball found: /tmp/cache-prek.tar.gz"
         else
-          echo "❌ Cache tarball missing. Expected /tmp/cache-pre-commit.tar.gz"
+          echo "❌ Cache tarball missing. Expected /tmp/cache-prek.tar.gz"
           exit 1
         fi
-      if: steps.restore-pre-commit-cache.outputs.stash-hit == 'true'
+      if: steps.restore-prek-cache.outputs.stash-hit == 'true'
     - name: "Restore .cache from the tar file"
-      run: tar -C ~ -xzf /tmp/cache-pre-commit.tar.gz
+      run: tar -C ~ -xzf /tmp/cache-prek.tar.gz
       shell: bash
-      if: steps.restore-pre-commit-cache.outputs.stash-hit == 'true'
+      if: steps.restore-prek-cache.outputs.stash-hit == 'true'
     - name: "Show restored files"
       run: |
         echo "Restored files"
         du ~/ --max-depth=2
         echo
       shell: bash
-      if: steps.restore-pre-commit-cache.outputs.stash-hit == 'true'
-    - name: Install pre-commit hooks
+      if: steps.restore-prek-cache.outputs.stash-hit == 'true'
+    - name: Install prek hooks
       shell: bash
-      run: pre-commit install-hooks || (cat ~/.cache/pre-commit/pre-commit.log 
&& exit 1)
+      run: prek install-hooks || (cat ~/.cache/prek/prefligit.log && exit 1)

Review Comment:
   Updated. Also reviewed and updated documentation. Also added `-f` option to 
replace installation in case `pre-commit` is already used.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to