Skip to content

[ONE LINE CHANGE] Rename Polybius PR Review workflow to Brunson PR Review Workflow #1

[ONE LINE CHANGE] Rename Polybius PR Review workflow to Brunson PR Review Workflow

[ONE LINE CHANGE] Rename Polybius PR Review workflow to Brunson PR Review Workflow #1

name: Brunson PR Review
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
issue_comment:
types: [created]
permissions: {}
jobs:
review:
if: >-
github.event_name == 'pull_request' &&
!github.event.pull_request.draft
runs-on: ubuntu-latest
steps:
- name: Trigger Brunson PR review
run: |
jq -n \
--arg type "pr_review" \
--arg channel "${{ secrets.POLYBIUS_CHANNEL_ID }}" \
--arg repo "${{ github.repository }}" \
--argjson pr_number ${{ github.event.pull_request.number }} \
--arg event "${{ github.event.action }}" \
--argjson wait true \
'{type:$type,channel:$channel,repo:$repo,pr_number:$pr_number,event:$event,wait:$wait}' \
| curl -sSf --max-time 660 -X POST "${{ secrets.POLYBIUS_WEBHOOK_URL }}/webhook" \
-H "Authorization: Bearer ${{ secrets.POLYBIUS_WEBHOOK_SECRET }}" \
-H "Content-Type: application/json" \
-d @-
comment:
if: >-
github.event_name == 'issue_comment' &&
github.event.issue.pull_request
runs-on: ubuntu-latest
steps:
- name: Trigger Brunson PR comment handler
env:
COMMENT_BODY: ${{ github.event.comment.body }}
run: |
jq -n \
--arg type "pr_comment" \
--arg channel "${{ secrets.POLYBIUS_CHANNEL_ID }}" \
--arg repo "${{ github.repository }}" \
--argjson pr_number ${{ github.event.issue.number }} \
--arg comment_author "${{ github.event.comment.user.login }}" \
--arg comment_body "$COMMENT_BODY" \
--arg comment_url "${{ github.event.comment.html_url }}" \
'{type:$type,channel:$channel,repo:$repo,pr_number:$pr_number,comment_author:$comment_author,comment_body:$comment_body,comment_url:$comment_url}' \
| curl -sSf --max-time 10 -X POST "${{ secrets.POLYBIUS_WEBHOOK_URL }}/webhook" \
-H "Authorization: Bearer ${{ secrets.POLYBIUS_WEBHOOK_SECRET }}" \
-H "Content-Type: application/json" \
-d @-