Skip to content

commenting on PR by yorickdowne #95

commenting on PR by yorickdowne

commenting on PR by yorickdowne #95

Workflow file for this run

# Safely comment on the PR - https://securitylab.github.com/resources/github-actions-preventing-pwn-requests/
name: Comment on pull request
run-name: commenting on PR by ${{ github.actor }}
on:
workflow_run:
workflows: [ "ci-runner" ]
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 artifacts
uses: actions/download-artifact@v4
with:
name: results
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: 'Comment on PR'
uses: actions/github-script@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
var fs = require('fs');
var issue_number = Number(fs.readFileSync('./issue_number'));
await github.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue_number,
body: fs.readFileSync('./coverage-text-report').toString()
});