File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -978,22 +978,19 @@ end
978978# This function is Buildkite-specific
979979def generate_installable_build_number
980980
981- # This should work outside of Buildkite
982- if ENV [ 'BUILDKITE' ] != 'true'
983- require 'git'
981+ if ENV [ 'BUILDKITE' ]
982+ commit = ENV [ 'BUILDKITE_COMMIT' ] [ 0 , 7 ]
983+ branch = ENV [ 'BUILDKITE_BRANCH' ]
984+ pr_num = ENV [ 'BUILDKITE_PULL_REQUEST' ]
984985
986+ return pr_num == 'false' ? "#{ branch } -#{ commit } " : "pr#{ pr_number } -#{ commit } "
987+ else
985988 repo = Git . open ( PROJECT_ROOT_FOLDER )
986- current_branch = repo . current_branch
987- current_commit = repo . revparse ( 'HEAD' ) [ 0 , 7 ]
989+ commit = repo . current_branch
990+ branch = repo . revparse ( 'HEAD' ) [ 0 , 7 ]
988991
989- return "#{ current_branch } -#{ current_commit } "
992+ return "#{ branch } -#{ commit } "
990993 end
991-
992- if ENV [ 'BUILDKITE_PULL_REQUEST' ] == 'false'
993- return "#{ ENV [ 'BUILDKITE_BRANCH' ] } -#{ ENV [ 'BUILDKITE_COMMIT' ] [ 0 , 7 ] } "
994- end
995-
996- return "pr#{ ENV [ 'BUILDKITE_PULL_REQUEST' ] } -#{ ENV [ 'BUILDKITE_COMMIT' ] [ 0 , 7 ] } "
997994end
998995
999996# Application-agnostic settings for the `upload_to_app_store` action, also
You can’t perform that action at this time.
0 commit comments