-
-
Save anonymous/3a3ba8925570bb3fd5d623cd98755f8a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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