Skip to content

Instantly share code, notes, and snippets.

/Foo.rb Secret

Created January 23, 2018 22:45
Show Gist options
  • Save anonymous/3a3ba8925570bb3fd5d623cd98755f8a to your computer and use it in GitHub Desktop.
Save anonymous/3a3ba8925570bb3fd5d623cd98755f8a to your computer and use it in GitHub Desktop.
def branch_name_for_build
Fastlane::Actions::GithubApiAction.run(
server_url: "https://api.github.com",
api_token: @GITHUB_API_TOKEN,
http_method: "GET",
path: "/repos/beachbodydigital/devices-bod-ios/pulls/23",
error_handlers: {
'*' => proc do |result|
raise "This build is from a PR but the request to GitHub's PR API for PR metadata failed."
end
}
) do |result|
title = result[:json]['title']
puts(title) # some-title
title
end
branch_name = branch_name_for_build
puts("Building with branch name: '#{branch_name}'") # Building with branch name: '{:status=>200, :body=>"{\"url\":\"https://a...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment