Skip to content

Commit

Permalink
using securerandom instead of uuid
Browse files Browse the repository at this point in the history
  • Loading branch information
milind009 committed Feb 24, 2021
1 parent 91c4d97 commit ee5f605
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
1 change: 0 additions & 1 deletion common/dependabot-common.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ Gem::Specification.new do |spec|
spec.add_dependency "pandoc-ruby", "~> 2.0"
spec.add_dependency "parser", ">= 2.5", "< 4.0"
spec.add_dependency "toml-rb", ">= 1.1.2", "< 3.0"
spec.add_dependency "uuid", "~> 2.3.9"

spec.add_development_dependency "byebug", "~> 11.0"
spec.add_development_dependency "gpgme", "~> 2.0"
Expand Down
5 changes: 2 additions & 3 deletions common/lib/dependabot/pull_request_updater/azure.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

require "dependabot/clients/azure"
require "uuid"
require "securerandom"

module Dependabot
class PullRequestUpdater
Expand All @@ -19,7 +19,6 @@ def initialize(source:, files:, base_commit:, old_commit:,
@old_commit = old_commit
@credentials = credentials
@pull_request_number = pull_request_number
@uuid = UUID.new
end

def update
Expand Down Expand Up @@ -84,7 +83,7 @@ def create_temp_branch

def temp_branch_name
@temp_branch_name ||=
"#{source_branch_name}-temp-#{@uuid.generate[0..6]}"
"#{source_branch_name}-temp-#{SecureRandom.uuid[0..6]}"
end

def update_branch(branch_name, old_commit, new_commit)
Expand Down

0 comments on commit ee5f605

Please sign in to comment.