Skip to content

Commit

Permalink
Don't try to post unit test results for fork PRs (#27)
Browse files Browse the repository at this point in the history
Also, suppress comments on PRs with unit test results.
  • Loading branch information
brantburnett authored Nov 3, 2020
1 parent 6876d6e commit d7b234a
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
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
dotnet nuget push **/*.nupkg --api-key ${{ secrets.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json

0 comments on commit d7b234a

Please sign in to comment.