Skip to content

on issue opened

on issue opened #28

name: on issue opened
on:
pull_request_review_comment:
types: [created]
jobs:
comment:
runs-on: ubuntu-latest
steps:
- name: checkout-branch
uses: actions/checkout@v3
- name: check-comment
id: check-comment
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const result = await github.rest.pulls.listReviewComments({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number,
});
const recentComment = result.data?.at(-1).body;
if(recentComment.includes('NTC')) return true;
else return false;
- name: make-this-pr-to-draft
if: ${{ steps.check-comment.outputs.result == 'true' }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh pr ready --undo ${{ github.event.pull_request.number }}
# github.rest.pulls.listReviewComments({
# owner: context.repo.owner,
# repo: context.repo.repo,
# pull_number: context.issue.number,
# })
# owner,
# repo,
# pull_number,
# review_id,