-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathaction.yml
67 lines (65 loc) · 2.31 KB
/
action.yml
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: 'Find, create or update comment'
description: 'Tries to find a comment and updates it if found, if not creates it.'
branding:
icon: 'message-square'
color: 'gray-dark'
inputs:
token:
description: 'GITHUB_TOKEN or a repo scoped PAT.'
required: true
default: ${{ github.token }}
repository:
description: 'The full name of the repository containing the issue or pull request where to find, create or update the comment.'
required: true
default: ${{ github.repository }}
issue-number:
description: 'The number of the issue or pull request in which to find, create or update the comment.'
required: true
body-includes:
description: 'A string to search for in the body of comments.'
required: true
comment-author:
description: 'The GitHub user name of the comment author.'
required: false
default: ''
body:
description: 'The comment body.'
required: true
edit-mode:
description: 'The mode when updating a comment: replace or append.'
required: true
reactions:
description: 'A comma separated list of reactions to add to the comment (+1, -1, laugh, confused, heart, hooray, rocket, eyes).'
required: false
default: ''
runs:
using: "composite"
steps:
- name: Find Comment
uses: peter-evans/find-comment@v2.4.0
id: find-comment
with:
token: ${{ inputs.token }}
repository: ${{ inputs.repository }}
issue-number: ${{ inputs.issue-number }}
body-includes: ${{ inputs.body-includes }}
comment-author: ${{ inputs.comment-author }}
- name: Create comment
uses: peter-evans/create-or-update-comment@v3.0.1
if: steps.find-comment.outputs.comment-id == 0
with:
token: ${{ inputs.token }}
repository: ${{ inputs.repository }}
issue-number: ${{ inputs.issue-number }}
body: ${{ inputs.body }}
reactions: ${{ inputs.reactions }}
- name: Update comment
uses: peter-evans/create-or-update-comment@v3.0.1
if: steps.find-comment.outputs.comment-id != 0
with:
token: ${{ inputs.token }}
repository: ${{ inputs.repository }}
comment-id: ${{ steps.find-comment.outputs.comment-id }}
edit-mode: ${{ inputs.edit-mode }}
body: ${{ inputs.body }}
reactions: ${{ inputs.reactions }}