Kamil Piechaczek преди 5 години
родител
ревизия
16cc89841b
променени са 1 файла, в които са добавени 7 реда и са изтрити 2 реда
  1. 7 2
      scripts/continuous-integration-script.js

+ 7 - 2
scripts/continuous-integration-script.js

@@ -92,8 +92,7 @@ for ( const fullPackageName of packages ) {
 
 console.log( 'Uploading combined code coverage report…' );
 
-// Comparing "organization/ckeditor5" and "ckeditor/ckeditor5".
-if ( process.env.TRAVIS_PULL_REQUEST_SLUG === process.env.TRAVIS_REPO_SLUG ) {
+if ( shouldUploadCoverageReport() ) {
 	childProcess.execSync( 'npx coveralls < .out/combined_lcov.info' );
 } else {
 	console.log( 'Since the PR comes from the community, we do not upload code coverage report.' );
@@ -158,3 +157,9 @@ function appendCoverageReport() {
 		} );
 	} );
 }
+
+function shouldUploadCoverageReport() {
+	// If the repository slugs are different, the pull request comes from the community (forked repository).
+	// For such builds, sending the CC report will be disabled.
+	return ( process.env.TRAVIS_EVENT_TYPE !== 'pull_request' || process.env.TRAVIS_PULL_REQUEST_SLUG === process.env.TRAVIS_REPO_SLUG );
+}