rusackas commented on code in PR #45610:
URL: https://github.com/apache/superset/pull/45610#discussion_r4353485537
##########
.github/workflows/pre-commit.yml:
##########
@@ -151,6 +126,56 @@ jobs:
} >> "$GITHUB_OUTPUT"
fi
+ # The frontend and docs hooks are the only ones that need node_modules,
+ # and prek only runs hooks whose file filters match the changed files.
+ # Skip the installs (about 30 s for superset-frontend, 60 s for docs)
+ # when nothing under those trees changed; "all" (schedules, or no diff
+ # base) still installs both.
+ - name: Determine which node dependencies the hooks need
+ id: node_deps
+ env:
+ MODE: ${{ steps.changed_files.outputs.mode }}
+ CHANGED_FILES: ${{ steps.changed_files.outputs.files }}
+ run: |
+ set -euo pipefail
+ frontend=false; docs=false
+ if [ "${MODE}" = "all" ]; then
+ frontend=true; docs=true
+ elif [ "${MODE}" = "files" ]; then
+ if printf '%s\n' "${CHANGED_FILES}" | grep -qE
'^(superset-frontend|superset-websocket)/'; then frontend=true; fi
Review Comment:
Good catch @sadpandajoe, switched both checks to here-strings so there is no
pipe left to break.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]