comment #4599
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
| --- | |
| # yamllint disable rule:line-length | |
| name: "comment" | |
| on: # yamllint disable-line rule:truthy | |
| workflow_run: | |
| workflows: | |
| - rstcheck | |
| - check_toc_txt | |
| - check-files | |
| types: | |
| - completed | |
| permissions: | |
| pull-requests: write # Required to leave a comment on a review | |
| jobs: | |
| comment: | |
| name: Comment | |
| runs-on: ubuntu-latest | |
| if: ${{ github.event.workflow_run.event == 'pull_request' }} | |
| steps: | |
| - name: Download artifact | |
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | |
| with: | |
| name: results | |
| run-id: ${{ github.event.workflow_run.id }} | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| path: results | |
| - name: Update pr with info from other runners | |
| uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| script: | | |
| var fs = require('fs'); | |
| var issue_number = Number(fs.readFileSync('./results/id')); | |
| var problem_count = Number(fs.readFileSync( | |
| './results/problem-count' | |
| )); | |
| var summary = String(fs.readFileSync('./results/summary')); | |
| if (problem_count > 0) { | |
| github.rest.issues.createComment({ | |
| owner: context.repo.owner, | |
| issue_number: issue_number, | |
| repo: context.repo.repo, | |
| body: summary | |
| }); | |
| } |