Skip to content

Commit

Permalink
feat: support setting the --main-branch for a pacticipant
Browse files Browse the repository at this point in the history
  • Loading branch information
bethesque committed Sep 30, 2021
1 parent 7d1dc63 commit 1f18e70
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,8 @@ Options:
# Pacticipant name
[--display-name=DISPLAY_NAME]
# Display name
[--main-branch=MAIN_BRANCH]
# The main development branch of the pacticipant repository
[--repository-url=REPOSITORY_URL]
# The repository URL of the pacticipant
-o, [--output=OUTPUT]
Expand Down
3 changes: 2 additions & 1 deletion lib/pact_broker/client/cli/pacticipant_commands.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ module PactBroker
module Client
module CLI
module PacticipantCommands
PACTICIPANT_PARAM_NAMES = [:name, :display_name, :repository_url]
PACTICIPANT_PARAM_NAMES = [:name, :display_name, :main_branch, :repository_url]

def self.included(thor)
thor.class_eval do
desc 'create-or-update-pacticipant', 'Create or update pacticipant by name'
method_option :name, type: :string, required: true, desc: "Pacticipant name"
method_option :display_name, type: :string, desc: "Display name"
method_option :main_branch, type: :string, required: false, desc: "The main development branch of the pacticipant repository"
method_option :repository_url, type: :string, required: false, desc: "The repository URL of the pacticipant"
output_option_json_or_text
shared_authentication_options
Expand Down
3 changes: 2 additions & 1 deletion lib/pact_broker/client/pacticipants/create.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ def pacticipant_resource_params
{
name: params[:name],
repositoryUrl: params[:repository_url],
displayName: params[:display_name]
displayName: params[:display_name],
mainBranch: params[:main_branch]
}.compact
end
end
Expand Down

0 comments on commit 1f18e70

Please sign in to comment.