Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit db969b6

Browse files
authored
Merge pull request #720 from utPLSQL/feature/disable_sonar_pr_from_others
Fixed issue with sonar scanner failing on PR's from other repositories.
2 parents bf686c2 + 2717e97 commit db969b6

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

.travis/run_sonar_scanner.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ else
3030
fi
3131

3232

33-
#Are we running on develop branch ?
33+
#Are we running on utPLSQL repo and not an external PR?
3434
echo "Check if we running from develop or on branch"
3535
if [ "${TRAVIS_REPO_SLUG}" = "${UTPLSQL_REPO}" ] && [[ ! "${BRANCH}" =~ ^(release/v[0-9]+\.[0-9]+\.[0-9]+.*|"${MAIN_DEV_BRANCH}")$ ]]; then
3636

@@ -39,12 +39,14 @@ if [ "${TRAVIS_REPO_SLUG}" = "${UTPLSQL_REPO}" ] && [[ ! "${BRANCH}" =~ ^(releas
3939
echo "Updating sonar properties to include branch ${BRANCH}"
4040
add_sonar_property "${BRANCH_SONAR_PROPERTY}" "${BRANCH}"
4141
add_sonar_property "${BRANCH_SONAR_TARGET_PROPERTY}" "${MAIN_DEV_BRANCH}"
42-
else
42+
elif [ "${TRAVIS_PULL_REQUEST_SLUG}" = "${TRAVIS_REPO_SLUG}" ]; then
4343
echo "Updating sonar properties to include pull request ${BRANCH}"
4444
add_sonar_property "${PR_SONAR_TOKEN_PROPERTY}" "${GITHUB_TRAVISCI_TOKEN}"
4545
add_sonar_property "${PR_SONAR_BRANCH_PROPERTY}" "${BRANCH}"
4646
add_sonar_property "${PR_KEY_PROPERTY}" "${PR}"
4747
add_sonar_property "${PR_SONAR_BASE_PROPERTY}" "${PR_BRANCH}"
48+
else
49+
echo "PR from external source no changes to properties."
4850
fi
4951
else
5052
echo "No need to update sonar we building on release or develop"

0 commit comments

Comments
 (0)