Skip to content

comment

comment #334

Workflow file for this run

---
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
});
}