Skip to content

comment_on_pr

comment_on_pr #19

Workflow file for this run

name: comment_on_pr
# read-write repo token
# access to secrets
on:
workflow_run:
workflows: ["simmetrx_enabled_pr_comment_trigger_self_hosted"]
types:
- completed
jobs:
upload:
permissions:
actions: read
issues: write
pull-requests: write
runs-on: ubuntu-latest
if: |
github.event.workflow_run.conclusion == 'success' ||
github.event.workflow_run.conclusion == 'failure'
steps:
- name: 'Download artifact'
uses: actions/download-artifact@v4
with:
name: pr
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ github.token }}
- name: 'Comment on PR'
uses: actions/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
var fs = require('fs');
var issue_number = Number(fs.readFileSync('./issueNumber'));
var message = String(fs.readFileSync('./message'));
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue_number,
body: message
});