comment #319
This file contains 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: | |
workflow_run: | |
workflows: | |
- rstcheck | |
types: | |
- completed | |
jobs: | |
comment: | |
name: Comment | |
runs-on: ubuntu-latest | |
if: ${{ github.event.workflow_run.event == 'pull_request' }} | |
steps: | |
- name: Download artifact | |
uses: actions/download-artifact@v4 | |
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@v7 | |
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 | |
}); | |
} |