From 754cfd6e1fb1a35c63407f69493febc47ec78f02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?LeoYuan=20=E8=A2=81=E5=8A=9B=E7=9A=93?= Date: Sat, 7 May 2022 16:23:55 +0800 Subject: [PATCH] chore: skip coverage job if PR is from fork --- .github/workflows/cov packages.yml | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/.github/workflows/cov packages.yml b/.github/workflows/cov packages.yml index c9dac58f1..aa80d5f3a 100644 --- a/.github/workflows/cov packages.yml +++ b/.github/workflows/cov packages.yml @@ -1,4 +1,4 @@ -name: lint & test +name: coverage on: pull_request: @@ -8,10 +8,9 @@ on: jobs: cov-designer: - permissions: - checks: write - pull-requests: write runs-on: ubuntu-latest + # skip fork's PR, otherwise it fails while making a comment + if: ${{ github.event.pull_request.head.repo.full_name == 'alibaba/lowcode-engine' }} steps: - name: checkout uses: actions/checkout@v2 @@ -29,13 +28,12 @@ jobs: test-script: npm test -- --jest-ci --jest-json --jest-coverage --jest-testLocationInResults --jest-outputFile=report.json skip-step: install annotations: none - package-manager: yarn + base-coverage-file: ./report.json cov-renderer-core: - permissions: - checks: write - pull-requests: write runs-on: ubuntu-latest + # skip fork's PR, otherwise it fails while making a comment + if: ${{ github.event.pull_request.head.repo.full_name == 'alibaba/lowcode-engine' }} steps: - name: checkout uses: actions/checkout@v2 @@ -53,13 +51,12 @@ jobs: test-script: npm test -- --jest-ci --jest-json --jest-coverage --jest-testLocationInResults --jest-outputFile=report.json skip-step: install annotations: none - package-manager: yarn + base-coverage-file: ./report.json cov-react-simulator-renderer: - permissions: - checks: write - pull-requests: write runs-on: ubuntu-latest + # skip fork's PR, otherwise it fails while making a comment + if: ${{ github.event.pull_request.head.repo.full_name == 'alibaba/lowcode-engine' }} steps: - name: checkout uses: actions/checkout@v2 @@ -77,4 +74,4 @@ jobs: test-script: npm test -- --jest-ci --jest-json --jest-coverage --jest-testLocationInResults --jest-outputFile=report.json skip-step: install annotations: none - package-manager: yarn \ No newline at end of file + base-coverage-file: ./report.json \ No newline at end of file