Skip to content

Commit

Permalink
bump corepack to fix freezes (#11126)
Browse files Browse the repository at this point in the history
  • Loading branch information
jakecoffman authored Dec 20, 2024
1 parent 1cb627b commit 2c7a4a0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion npm_and_yarn/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM ghcr.io/dependabot/dependabot-updater-core

# Check for updates at https://github.com/nodejs/corepack/releases
ARG COREPACK_VERSION=0.24.0
ARG COREPACK_VERSION=0.30.0

# Check for updates at https://github.com/pnpm/pnpm/releases
ARG PNPM_VERSION=9.15.0
Expand Down
18 changes: 17 additions & 1 deletion npm_and_yarn/lib/dependabot/npm_and_yarn/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,31 @@ def self.semver_for(version)

sig { override.params(version: VersionParameter).void }
def initialize(version)
version = clean_version(version)

@version_string = T.let(version.to_s, String)
version = version.gsub(/^v/, "") if version.is_a?(String)

@build_info = T.let(nil, T.nilable(String))

version, @build_info = version.to_s.split("+") if version.to_s.include?("+")

super(T.must(version))
end

sig { params(version: VersionParameter).returns(VersionParameter) }
def clean_version(version)
# Check if version is a string before attempting to match
if version.is_a?(String)
# Matches @ followed by x.y.z (digits separated by dots)
if (match = version.match(/@(\d+\.\d+\.\d+)/))
version = match[1] # Just "4.5.3"
end
version = version&.gsub(/^v/, "")
end

version
end

sig { override.params(version: VersionParameter).returns(Dependabot::NpmAndYarn::Version) }
def self.new(version)
T.cast(super, Dependabot::NpmAndYarn::Version)
Expand Down

0 comments on commit 2c7a4a0

Please sign in to comment.