From 954bbca3838d473c135cfa3dce6d0836c4d21f6e Mon Sep 17 00:00:00 2001 From: Akash Jain <15995028+akash-jain-10@users.noreply.github.com> Date: Wed, 6 Apr 2022 11:34:03 +0530 Subject: [PATCH] fix: Ability to run CI from forked Repository (#3874) * Ability to run CI from forked Repository * Update yarn-coverage.yml --- .github/workflows/yarn-coverage.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/yarn-coverage.yml b/.github/workflows/yarn-coverage.yml index 65488357087..8a625ae4d54 100644 --- a/.github/workflows/yarn-coverage.yml +++ b/.github/workflows/yarn-coverage.yml @@ -8,7 +8,7 @@ on: - main paths: - openmetadata-ui/src/main/resources/ui/** - pull_request: + pull_request_target: types: [opened, synchronize, reopened] paths: - openmetadata-ui/src/main/resources/ui/** @@ -23,6 +23,7 @@ jobs: steps: - uses: actions/checkout@v2 with: + ref: ${{ github.event.pull_request.head.sha }} # Disabling shallow clone is recommended for improving relevancy of reporting fetch-depth: 0 - name: Use Node.js ${{ matrix.node-version }} @@ -41,7 +42,7 @@ jobs: run: npm install -g sonarqube-scanner id: npm_install_sonar_scanner - name: SonarCloud Scan On PR - if: github.event_name == 'pull_request' && steps.npm_install_sonar_scanner.outcome == 'success' + if: github.event_name == 'pull_request_target' && steps.npm_install_sonar_scanner.outcome == 'success' working-directory: ${{ env.UI_WORKING_DIRECTORY }} run: | sonar-scanner -Dsonar.host.url=${SONARCLOUD_URL} \ @@ -65,4 +66,4 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.UI_SONAR_TOKEN }} - SONARCLOUD_URL: https://sonarcloud.io \ No newline at end of file + SONARCLOUD_URL: https://sonarcloud.io