Skip to content

Commit

Permalink
Fixed ronin-repos new specs when ran in the CI environment.
Browse files Browse the repository at this point in the history
* Set the `git` `user.name` and `user.email`, if not already set, so that
  the `git commit` command succeeds when ran in the CI environment.
  • Loading branch information
postmodern committed Apr 14, 2024
1 parent 87509fb commit 9d7ffe9
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions spec/cli/commands/new_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,19 @@
@name = 'new-repo'
@path = File.join(@root,@name)

@git_name = `git config --global user.name`
@git_email = `git config --global user.email`
@github_user = Ronin::Core::Git.github_user || ENV['USER']

if @git_name.empty?
# ensure that we set the git author name and email in the CI
@git_name = 'Test User'
@git_email = '[email protected]'

system('git','config','--global','user.name',@git_name)
system('git','config','--global','user.email',@git_email)
end

described_class.main(@path)
end

Expand Down

0 comments on commit 9d7ffe9

Please sign in to comment.