Skip to content

Commit 7d2f639

Browse files
committed
update to allow testing help on branch
1 parent 742e247 commit 7d2f639

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

.github/workflows/help-command.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,20 @@ name: Help Command
33
on:
44
issue_comment:
55
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
612

713
permissions:
814
issues: write
915
pull-requests: write
1016

1117
jobs:
1218
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' }}
1420
runs-on: ubuntu-latest
1521

1622
steps:
@@ -132,9 +138,13 @@ jobs:
132138
133139
const helpText = generateHelpText();
134140
141+
const prNumber = context.eventName === 'workflow_dispatch'
142+
? parseInt(context.payload.inputs.pr_number)
143+
: context.issue.number;
144+
135145
await github.rest.issues.createComment({
136146
owner: context.repo.owner,
137147
repo: context.repo.repo,
138-
issue_number: context.issue.number,
148+
issue_number: prNumber,
139149
body: helpText
140150
});

0 commit comments

Comments
 (0)