File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change 9
9
# commit-sha: 6953daa563e8e44512bc349c9608484cfd4ec4ff
10
10
# timestamp: 2024-03-04T19:29:16Z
11
11
12
+ # Required env variables:
13
+ # - BUILDKITE_BRANCH
14
+ # - BUILDKITE_COMMIT
15
+
12
16
output_path=" $1 "
13
17
14
- echo " commit-sha: $( git rev-parse HEAD) " > " $output_path "
18
+ if [ " $BUILDKITE_BRANCH " != " master" ] && [ " $BUILDKITE_BRANCH " != " origin/master" ]; then
19
+ echo " Coverage metadata is only generated for master branch. Current branch: $BUILDKITE_BRANCH "
20
+ exit 0
21
+ fi
22
+
23
+ if [ -z " $BUILDKITE_COMMIT " ]; then
24
+ echo " BUILDKITE_COMMIT is not set"
25
+ exit 1
26
+ fi
27
+
28
+ echo " commit-sha: $BUILDKITE_COMMIT " > " $output_path "
15
29
echo " timestamp: $( date -u +%Y-%m-%dT%H:%M:%SZ) " >> " $output_path "
16
30
17
31
echo " Coverage metadata written to $output_path "
Original file line number Diff line number Diff line change @@ -81,6 +81,8 @@ services:
81
81
dockerfile : ./docker/buildkite/Dockerfile
82
82
environment :
83
83
- " GO111MODULE=on"
84
+ - BUILDKITE_BRANCH
85
+ - BUILDKITE_COMMIT
84
86
volumes :
85
87
- ../../:/go/src/go.uber.org/cadence
86
88
networks :
You can’t perform that action at this time.
0 commit comments