Skip to content

ci: add prettier workflow and refactor others #6

ci: add prettier workflow and refactor others

ci: add prettier workflow and refactor others #6

name: Forward comment with command to review comment
on:
issue_comment:
types: [created]
jobs:
forward:
if: |
contains(github.event.comment.html_url, '/pull/') &&
startsWith(github.event.comment.body, '/') &&
contains(fromJSON(vars.COMMANDS_TO_FORWARD), github.event.comment.body)
timeout-minutes: 30
runs-on: ubuntu-latest
container:
image: node:${{vars.NODE_VERSION}}-alpine
steps:
- name: Remove original comment
uses: actions/github-script@v6
with:
github-token: ${{ secrets.BOT_TOKEN }}
script: |
github.rest.issues.deleteComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: context.payload.comment.id,
});
- name: Create review comment
uses: actions/github-script@v6
with:
github-token: ${{ secrets.BOT_TOKEN }}
script: |
github.rest.pulls.createReview({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.payload.issue.number,
body: context.payload.comment.body,
event: "COMMENT"
});