Comment on the Pull Request #173
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Comment on the Pull Request | |
| # read-write repo token | |
| # See: https://securitylab.github.com/research/github-actions-preventing-pwn-requests/ | |
| # Don't remove this file - read on at: https://blog.nimblepros.com/blogs/using-workflow-run-in-github-actions/ | |
| on: | |
| workflow_run: | |
| workflows: ["eShopOnNServiceBus Build and Test"] | |
| types: | |
| - completed | |
| permissions: | |
| actions: read | |
| contents: read | |
| pull-requests: write | |
| jobs: | |
| get-inputs: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| pr-number: ${{ steps.prNumber.outputs.PR_NUMBER }} | |
| artifact-name: ${{ steps.artifactName.outputs.CODE_COVERAGE_ARTIFACT_NAME }} | |
| artifact-path: ${{ steps.artifactPath.outputs.CODE_COVERAGE_ARTIFACT_PATH }} | |
| steps: | |
| - name: Get the workflow outputs artifact | |
| uses: dawidd6/action-download-artifact@v11 | |
| with: | |
| workflow: ${{ github.event.workflow_run.workflow_id }} | |
| workflow_conclusion: success | |
| name: workflow-outputs | |
| - name: Read PR Number into GitHub environment variables | |
| id: prNumber | |
| run: echo "PR_NUMBER=$(cat pr_number.txt)" >> $GITHUB_OUTPUT | |
| - name: Read Code Coverage Artifact Name into GitHub environment variables | |
| id: artifactName | |
| run: echo "CODE_COVERAGE_ARTIFACT_NAME=$(cat artifact_name.txt)" >> $GITHUB_OUTPUT | |
| - name: Read Code Coverage Artifact Path into GitHub environment variables | |
| id: artifactPath | |
| run: echo "CODE_COVERAGE_ARTIFACT_PATH=$(cat artifact_path.txt)" >> $GITHUB_OUTPUT | |
| add-code-coverage-to-pr: | |
| needs: get-inputs | |
| uses: NimblePros/NimblePros.GitHub.Workflows/.github/workflows/comment-on-pr.yml@main | |
| with: | |
| pr-number: ${{ needs.get-inputs.outputs.pr-number }} | |
| code-coverage-artifact-name: ${{ needs.get-inputs.outputs.artifact-name }} | |
| code-coverage-artifact-path: ${{ needs.get-inputs.outputs.artifact-path }} |