Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"why:batch": "./scripts/why-batch.sh"
},
"simple-git-hooks": {
"pre-commit": "yarn lint-staged && yarn dedupe --check",
"pre-commit": "./scripts/pre-commit.sh",
"post-rewrite": "yarn lint:dependencies"
},
"lint-staged": {
Expand Down
3 changes: 1 addition & 2 deletions scripts/playwright-install.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#!/bin/bash

# Skip in Dependabot environments (not needed and causes failures)
# DEPENDABOT is set in the updater environment, GITHUB_ACTOR in PR workflows
if [ -n "$DEPENDABOT" ] || [ "$GITHUB_ACTOR" = "dependabot[bot]" ]; then
if "$(dirname "$0")/utils/check-dependabot.sh"; then
echo "⏭️ Skipping Playwright install in Dependabot environment"
exit 0
fi
Expand Down
13 changes: 13 additions & 0 deletions scripts/pre-commit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

set -e

# Skip pre-commit hooks in Dependabot environments
if "$(dirname "$0")/utils/check-dependabot.sh"; then
echo "⏭️ Skipping pre-commit hook in Dependabot environment"
exit 0
fi

yarn lint-staged
yarn dedupe --check

3 changes: 1 addition & 2 deletions scripts/rebuild-native.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
# Pass --force or -f to rebuild even if build artifacts already exist.

# Skip in Dependabot environments (native builds aren't needed and may fail)
# DEPENDABOT is set in the updater environment, GITHUB_ACTOR in PR workflows
if [ -n "$DEPENDABOT" ] || [ "$GITHUB_ACTOR" = "dependabot[bot]" ]; then
if "$(dirname "$0")/utils/check-dependabot.sh"; then
echo "⏭️ Skipping native rebuild in Dependabot environment"
exit 0
fi
Expand Down
14 changes: 14 additions & 0 deletions scripts/utils/check-dependabot.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

# Shared utility to detect Dependabot environments
# Returns 0 (true) if running in a Dependabot environment, 1 (false) otherwise
#
# Environment variables checked:
# - DEPENDABOT: Set in the Dependabot updater environment
# - GITHUB_ACTOR: Set to "dependabot[bot]" in Dependabot PR workflows

is_dependabot_env() {
[ -n "$DEPENDABOT" ] || [ "$GITHUB_ACTOR" = "dependabot[bot]" ]
}

is_dependabot_env
Loading