Skip to content

Instantly share code, notes, and snippets.

@kishikawakatsumi
Created April 20, 2019 02:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kishikawakatsumi/5437868cf508a4e6e5e990bff0c03c5a to your computer and use it in GitHub Desktop.
Save kishikawakatsumi/5437868cf508a4e6e5e990bff0c03c5a to your computer and use it in GitHub Desktop.
lane :sync_bitrise_yml do
if !ENV['CI']
next
end
Dir.chdir("#{ENV['PWD']}") do
sh "curl -O -H 'Authorization: token #{ENV['BITRISE_ACCESS_TOKEN']}' 'https://api.bitrise.io/v0.1/apps/#{ENV['BITRISE_APP_SLUG']}/bitrise.yml'"
unless system('git diff --quiet --exit-code')
sh 'git add bitrise.yml'
commit_push_create_pr(branch_name: "ci/sync-bitrise_yml-#{Time.now.to_i}", message: 'Sync bitrise.yml')
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment