File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -3,14 +3,20 @@ name: Help Command
3
3
on :
4
4
issue_comment :
5
5
types : [created]
6
+ workflow_dispatch :
7
+ inputs :
8
+ pr_number :
9
+ description : ' Pull Request number to post help comment on'
10
+ required : true
11
+ type : string
6
12
7
13
permissions :
8
14
issues : write
9
15
pull-requests : write
10
16
11
17
jobs :
12
18
help :
13
- if : ${{ github.event.issue.pull_request && github.event.comment.body == '/help' }}
19
+ if : ${{ ( github.event.issue.pull_request && github.event.comment.body == '/help') || github.event_name == 'workflow_dispatch ' }}
14
20
runs-on : ubuntu-latest
15
21
16
22
steps :
@@ -132,9 +138,13 @@ jobs:
132
138
133
139
const helpText = generateHelpText();
134
140
141
+ const prNumber = context.eventName === 'workflow_dispatch'
142
+ ? parseInt(context.payload.inputs.pr_number)
143
+ : context.issue.number;
144
+
135
145
await github.rest.issues.createComment({
136
146
owner: context.repo.owner,
137
147
repo: context.repo.repo,
138
- issue_number: context.issue.number ,
148
+ issue_number: prNumber ,
139
149
body: helpText
140
150
});
You can’t perform that action at this time.
0 commit comments