Skip to content

Commit e094e15

Browse files
committed
Add --ignore-scripts to bun install/update commands
Skip lifecycle scripts (postinstall, prepare, etc.) when running bun for lockfile updates, matching npm/yarn behavior in dependabot-core. Avoids failures from packages that download binaries or run env-specific scripts (e.g. redis-memory-server postinstall failing with empty Content-Length). Lockfile content is unchanged; only script execution is disabled for security and reliability. Looking to add after seeing failures related to `redis-memory-server` in a private projects dependabot runs.
1 parent fb7b8fc commit e094e15

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

bun/lib/dependabot/bun/file_updater/bun_lockfile_updater.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,15 +93,15 @@ def run_bun_updater
9393
end.join(" ")
9494

9595
Helpers.run_bun_command(
96-
"install #{dependency_updates} --save-text-lockfile",
97-
fingerprint: "install <dependency_updates> --save-text-lockfile"
96+
"install #{dependency_updates} --save-text-lockfile --ignore-scripts",
97+
fingerprint: "install <dependency_updates> --save-text-lockfile --ignore-scripts"
9898
)
9999
end
100100

101101
sig { void }
102102
def run_bun_install
103103
Helpers.run_bun_command(
104-
"install --save-text-lockfile"
104+
"install --save-text-lockfile --ignore-scripts"
105105
)
106106
end
107107

bun/lib/dependabot/bun/update_checker/subdependency_version_resolver.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ def run_bun_updater(path, lockfile_name)
127127
SharedHelpers.with_git_configured(credentials: credentials) do
128128
Dir.chdir(path) do
129129
Helpers.run_bun_command(
130-
"update #{dependency.name} --save-text-lockfile",
131-
fingerprint: "update <dependency_name> --save-text-lockfile"
130+
"update #{dependency.name} --save-text-lockfile --ignore-scripts",
131+
fingerprint: "update <dependency_name> --save-text-lockfile --ignore-scripts"
132132
)
133133
{ lockfile_name => File.read(lockfile_name) }
134134
end

bun/lib/dependabot/bun/update_checker/version_resolver.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -637,8 +637,8 @@ def run_bun_checker(path:, version:)
637637
SharedHelpers.with_git_configured(credentials: credentials) do
638638
Dir.chdir(path) do
639639
Helpers.run_bun_command(
640-
"update #{dependency.name}@#{version} --save-text-lockfile",
641-
fingerprint: "update <dependency_name>@<version> --save-text-lockfile"
640+
"update #{dependency.name}@#{version} --save-text-lockfile --ignore-scripts",
641+
fingerprint: "update <dependency_name>@<version> --save-text-lockfile --ignore-scripts"
642642
)
643643
end
644644
end

0 commit comments

Comments
 (0)