diff --git a/cobalt/build/gyp_cobalt b/cobalt/build/gyp_cobalt index fdb4f441b0ac3..61de39da4ddcb 100755 --- a/cobalt/build/gyp_cobalt +++ b/cobalt/build/gyp_cobalt @@ -42,7 +42,7 @@ COMMIT_COUNT_BUILD_NUMBER_OFFSET = 1000000 # Matches numbers > 1000000. The pattern is basic so git log --grep is able to # interpret it. GIT_BUILD_NUMBER_PATTERN = r'[1-9]' + r'[0-9]' * 6 + r'[0-9]*' -BUILD_NUMBER_TAG_PATTERN = r'^BUILD_NUMBER={}$' +BUILD_NUMBER_TAG_PATTERN = r'^(Build-Id: |BUILD_NUMBER=){}$' # git log --grep can't handle capture groups. BUILD_NUBER_PATTERN_WITH_CAPTURE = '({})'.format(GIT_BUILD_NUMBER_PATTERN) @@ -125,7 +125,7 @@ def GetBuildNumberFromCommits(): BUILD_NUMBER_TAG_PATTERN.format(BUILD_NUBER_PATTERN_WITH_CAPTURE), flags=re.MULTILINE) match = full_pattern_with_capture.search(output) - return match.group(1) if match else None + return match.group(2) if match else None def GetBuildNumberFromServer():