diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index d6e3a61ae8..0e702d7b69 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -11,6 +11,7 @@ permissions: pull-requests: write contents: write packages: write + security-events: write on: push: @@ -61,11 +62,10 @@ jobs: output: both thresholds: '60 80' - - name: Add Coverage PR Comment - uses: marocchino/sticky-pull-request-comment@v2 + - uses: actions/upload-artifact@v4 if: github.event_name == 'pull_request' with: - recreate: true + name: coverage path: code-coverage-results.md - name: Package @@ -91,9 +91,6 @@ jobs: name: docfx-site path: docfx/docfx_project/_site/ - permissions: - security-events: write - publish_docs: name: Publish Documentation needs: build diff --git a/.github/workflows/pr-comment.yml b/.github/workflows/pr-comment.yml new file mode 100644 index 0000000000..57e952c700 --- /dev/null +++ b/.github/workflows/pr-comment.yml @@ -0,0 +1,28 @@ +name: Comment on pull request +on: + workflow_run: + workflows: + - .NET + types: + - completed + +jobs: + comment: + runs-on: ubuntu-latest + if: > + github.event.workflow_run.event == 'pull_request' && + github.event.workflow_run.conclusion == 'success' + + steps: + - name: Download coverage results + uses: actions/download-artifact@v4 + with: + name: coverage + path: code-coverage-results.md + + - name: Add coverage PR comment + uses: marocchino/sticky-pull-request-comment@v2 + with: + recreate: true + path: code-coverage-results.md +