mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-04-22 14:02:49 +08:00
check we are on master before pushing coverage report (#1143)
This means that forked PRs can now build as they don't need the coveralls secret
This commit is contained in:
parent
def55b3c3c
commit
08512ec1c0
@ -134,11 +134,12 @@ Task("RunUnitTests")
|
||||
var coverageSummaryFile = GetSubDirectories(artifactsForUnitTestsDir).First().CombineWithFilePath(File("coverage.opencover.xml"));
|
||||
Information(coverageSummaryFile);
|
||||
Information(artifactsForUnitTestsDir);
|
||||
|
||||
// todo bring back report generator to get a friendly report
|
||||
// ReportGenerator(coverageSummaryFile, artifactsForUnitTestsDir);
|
||||
// https://github.com/danielpalme/ReportGenerator
|
||||
|
||||
if (IsRunningOnCircleCI())
|
||||
if (IsRunningOnCircleCI() && IsMaster())
|
||||
{
|
||||
var repoToken = EnvironmentVariable(coverallsRepoToken);
|
||||
if (string.IsNullOrEmpty(repoToken))
|
||||
@ -498,3 +499,8 @@ private bool IsRunningOnCircleCI()
|
||||
{
|
||||
return !string.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable("CIRCLECI"));
|
||||
}
|
||||
|
||||
private bool IsMaster()
|
||||
{
|
||||
return Environment.GetEnvironmentVariable("CIRCLE_BRANCH").ToLower() == "master";
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user