-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
73 lines (59 loc) · 1.9 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
68
69
70
71
72
73
name: 'Create or update a comment'
description: 'Create or update a comment on an issue or PR'
inputs:
app-id:
description: 'The app ID of the app.'
private-key:
description: 'The private key of the app.'
issue-number:
required: false
description: 'Issue number'
comment-id:
required: false
description: 'Comment ID'
body:
required: true
description: 'Body of the comment'
identifier:
required: false
description: 'Hidden identifier to use for the comment'
outputs:
comment-id:
description: 'The ID of the comment that was created or updated'
value: ${{ inputs.comment-id || steps.find-comment.outputs.comment-id }}
runs:
using: composite
steps:
- uses: myparcelnl/actions/setup-app-credentials@v4
id: credentials
with:
app-id: ${{ inputs.app-id }}
private-key: ${{ inputs.private-key }}
- name: 'Create identifier'
id: prepare
shell: bash
env:
IDENTIFIER: ${{ inputs.identifier }}
#language=bash
run: |
identifier="myparcelnl/actions/create-or-update-comment"
if [ -n "$IDENTIFIER" ]; then
identifier="$identifier-$IDENTIFIER"
fi
echo "identifier=$identifier" >> $GITHUB_OUTPUT
- uses: peter-evans/find-comment@v3
if: inputs.comment-id == ''
id: find-comment
with:
body-includes: ${{ steps.prepare.outputs.identifier }}
comment-author: ${{ steps.credentials.outputs.git-name }}
issue-number: ${{ inputs.issue-number }}
- uses: peter-evans/create-or-update-comment@v4
with:
token: ${{ steps.credentials.outputs.token }}
comment-id: ${{ inputs.comment-id || steps.find-comment.outputs.comment-id }}
edit-mode: replace
issue-number: ${{ inputs.issue-number }}
body: |-
${{ inputs.body }}
<!-- ${{ steps.prepare.outputs.identifier }} -->