From bc52336a1bb04ebdb064f64a5eb5cf957be99ef4 Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Tue, 18 Dec 2018 11:42:05 -0800 Subject: [PATCH] affected_files metadata is only available for PR builds --- ci/test-coverage.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/ci/test-coverage.sh b/ci/test-coverage.sh index 14278bce6..b3cf53868 100755 --- a/ci/test-coverage.sh +++ b/ci/test-coverage.sh @@ -9,12 +9,14 @@ annotate() { } } -affectedFiles="$(buildkite-agent meta-data get affected_files)" -echo "Affected files in this PR: $affectedFiles" -if [[ ! ":$affectedFiles:" =~ \.rs: ]]; then - annotate --style info --context coverage-info \ - "Coverage skipped as no .rs files were modified" - exit 0 +if ci/is-pr.sh; then + affectedFiles="$(buildkite-agent meta-data get affected_files)" + echo "Affected files in this PR: $affectedFiles" + if [[ ! ":$affectedFiles:" =~ \.rs: ]]; then + annotate --style info --context coverage-info \ + "Coverage skipped as no .rs files were modified" + exit 0 + fi fi source ci/upload-ci-artifact.sh