From d7b234a7a0e933564555dceef1f715a42cfdd901 Mon Sep 17 00:00:00 2001 From: Brant Burnett Date: Mon, 2 Nov 2020 20:37:21 -0500 Subject: [PATCH] Don't try to post unit test results for fork PRs (#27) Also, suppress comments on PRs with unit test results. --- .github/workflows/main.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8fef9eb..ecca366 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -33,18 +33,21 @@ jobs: - name: Test run: dotnet test --configuration Release --no-build --verbosity normal --logger "junit;LogFilePath=test-results/results.xml" - name: Publish Unit Test Results - uses: EnricoMi/publish-unit-test-result-action@v1.3 - if: always() + uses: EnricoMi/publish-unit-test-result-action@f8a3fca6035d817e664cd0bf57d7fefc407847ee # pre-1.4, adds comment_on_pr option + if: > + github.event_name == 'push' || + github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository with: github_token: ${{ secrets.GITHUB_TOKEN }} check_name: Unit Tests files: '**/test-results/**/*.xml' report_individual_runs: true - + comment_on_pr: false + - name: Pack if: ${{ startsWith(github.ref, 'refs/tags/release/') }} run: dotnet pack --configuration Release -p:Version=${{ env.VERSION }} --no-build - name: Push to NuGet.org if: ${{ startsWith(github.ref, 'refs/tags/release/') }} run: | - dotnet nuget push **/*.nupkg --api-key ${{ secrets.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json \ No newline at end of file + dotnet nuget push **/*.nupkg --api-key ${{ secrets.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json