ci: add prettier workflow and refactor others #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | |
}); |