From 674ceea630dab281ee68d30df6291f8bc30b094c Mon Sep 17 00:00:00 2001 From: Shunjiro Yatsuzuka Date: Mon, 4 Jan 2021 16:20:38 +0900 Subject: [PATCH] Modify the branch name in github for push --- README.md | 2 +- example_app/github_repo_helper.rb | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 6ed6e7a..00ca0d9 100644 --- a/README.md +++ b/README.md @@ -98,7 +98,7 @@ With `cf`: $ cd github-service-broker-ruby/example_app/ $ cf push github-consumer $ cf create-service github-repo public github-repo-1 -$ cf bind-service github-repo-1 github-consumer +$ cf bind-service github-consumer github-repo-1 $ cf services # can be used to verify the binding was created $ cf restart github-consumer ``` diff --git a/example_app/github_repo_helper.rb b/example_app/github_repo_helper.rb index ca7013c..19e95f0 100644 --- a/example_app/github_repo_helper.rb +++ b/example_app/github_repo_helper.rb @@ -36,10 +36,10 @@ def credentials_for_repo_uri(uri) # - configure git ssh (known hosts, and private key file) # - clone the repo # - set git author - # - check out master + # - check out main branch # - create empty commit # - print the commit log - # - push commit to master + # - push commit to main branch # - delete private key # - delete ssh script # - delete cloned directory @@ -93,7 +93,7 @@ def shell_create_and_push_commit(repo_credentials, application_name) "cd #{temp_dir}/#{repo_name} && git config user.email '#{application_name}@example.com' 2>&1", "cd #{temp_dir}/#{repo_name} && git commit --allow-empty -m 'auto generated empty commit' 2>&1", "cd #{temp_dir}/#{repo_name} && git log --pretty=format:\"%h%x09%ad%x09%s\" 2>&1", - "cd #{temp_dir}/#{repo_name}; GIT_SSH=#{git_ssh_script} git push origin master 2>&1" + "cd #{temp_dir}/#{repo_name}; GIT_SSH=#{git_ssh_script} git push origin main 2>&1" ] return_code = 0