Skip to content

Commit 8e8419c

Browse files
committed
Use actual current commit id for build scan custom value (#52487)
1 parent 66bb9c3 commit 8e8419c

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

gradle/build-scan.gradle

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import org.elasticsearch.gradle.OS
2+
import org.elasticsearch.gradle.info.BuildParams
23
import org.gradle.initialization.BuildRequestMetaData
34

45
import java.util.concurrent.TimeUnit
@@ -76,14 +77,8 @@ buildScan {
7677
value 'Git Branch', branch
7778
tag branch
7879
}
79-
if (System.getenv('GIT_COMMIT')) {
80-
value 'Git Commit ID', System.getenv('GIT_COMMIT')
81-
link 'Source', "https://github.com/elastic/elasticsearch/tree/${System.getenv('GIT_COMMIT')}"
82-
background {
83-
def changes = "git diff --name-only ${System.getenv('GIT_PREVIOUS_COMMIT')}..${System.getenv('GIT_COMMIT')}".execute().text.trim()
84-
value 'Git Changes', changes
85-
}
86-
}
80+
value 'Git Commit ID', BuildParams.gitRevision
81+
link 'Source', "https://github.com/elastic/elasticsearch/tree/${BuildParams.gitRevision}"
8782
}
8883
} else {
8984
tag 'LOCAL'

0 commit comments

Comments
 (0)