-
Notifications
You must be signed in to change notification settings - Fork 58
50 lines (45 loc) · 1.63 KB
/
workflow-review.yml
File metadata and controls
50 lines (45 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# https://stackoverflow.com/questions/67247752/how-to-use-secret-in-pull-request-review-similar-to-pull-request-target
name: Dummy Workflow on review
on:
pull_request_review:
types: [submitted, edited]
permissions:
pull-requests: write
contents: write
issues: write
jobs:
dummy-workflow:
if: |
github.event.pull_request != '' &&
!contains(github.event.sender.login, 'coderabbitai[bot]')
runs-on: ubuntu-latest
steps:
- name: save the pr information
env:
COMMENT_BODY: ${{ github.event.comment.body }}
REVIEW_BODY: ${{ github.event.review.body }}
USER_LOGIN: ${{ github.event.sender.login }}
run: |
jq -n \
--arg pr_num "${{ github.event.pull_request.number || github.event.issue.number }}" \
--arg event_action "${{ github.event.action }}" \
--arg review_state "${{ github.event.review.state }}" \
--arg event_name "${{ github.event_name }}" \
--arg comment_body "$COMMENT_BODY" \
--arg review_comment_body "$REVIEW_BODY" \
--arg user_login "$USER_LOGIN" \
--arg action "add-remove-labels" \
'{
pr_num: $pr_num,
event_action: $event_action,
review_state: $review_state,
event_name: $event_name,
comment_body: $comment_body,
review_comment_body: $review_comment_body,
user_login: $user_login,
action: $action
}' >> context.json
- uses: actions/upload-artifact@v7
with:
name: context.json
path: ./