Selaa lähdekoodia

Improved the solution.

Kamil Piechaczek 5 vuotta sitten
vanhempi
commit
16cc89841b
1 muutettua tiedostoa jossa 7 lisäystä ja 2 poistoa
  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 );
+}