fix: Ability to run CI from forked Repository (#3874)

* Ability to run CI from forked Repository

* Update yarn-coverage.yml
This commit is contained in:
Akash Jain 2022-04-06 11:34:03 +05:30 committed by GitHub
parent 63533eb388
commit 954bbca383
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,7 +8,7 @@ on:
- main - main
paths: paths:
- openmetadata-ui/src/main/resources/ui/** - openmetadata-ui/src/main/resources/ui/**
pull_request: pull_request_target:
types: [opened, synchronize, reopened] types: [opened, synchronize, reopened]
paths: paths:
- openmetadata-ui/src/main/resources/ui/** - openmetadata-ui/src/main/resources/ui/**
@ -23,6 +23,7 @@ jobs:
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
with: with:
ref: ${{ github.event.pull_request.head.sha }}
# Disabling shallow clone is recommended for improving relevancy of reporting # Disabling shallow clone is recommended for improving relevancy of reporting
fetch-depth: 0 fetch-depth: 0
- name: Use Node.js ${{ matrix.node-version }} - name: Use Node.js ${{ matrix.node-version }}
@ -41,7 +42,7 @@ jobs:
run: npm install -g sonarqube-scanner run: npm install -g sonarqube-scanner
id: npm_install_sonar_scanner id: npm_install_sonar_scanner
- name: SonarCloud Scan On PR - 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 }} working-directory: ${{ env.UI_WORKING_DIRECTORY }}
run: | run: |
sonar-scanner -Dsonar.host.url=${SONARCLOUD_URL} \ sonar-scanner -Dsonar.host.url=${SONARCLOUD_URL} \
@ -65,4 +66,4 @@ jobs:
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.UI_SONAR_TOKEN }} SONAR_TOKEN: ${{ secrets.UI_SONAR_TOKEN }}
SONARCLOUD_URL: https://sonarcloud.io SONARCLOUD_URL: https://sonarcloud.io