Skip to content

Commit e61f896

Browse files
feat(action): allow processing issue_comment event (#55)
1 parent 92abc49 commit e61f896

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ Change these options in the workflow `.yml` file to meet your GitHub project nee
6464

6565
| Setting | Description | Values |
6666
| --- | --- | --- |
67-
| `on` | When the automation is ran | `issues` `pull_request` |
68-
| `types` | The types of activity that will trigger a workflow run. | `opened`, `assigned` |
67+
| `on` | When the automation is ran | `issues` `pull_request` `issue_comment` |
68+
| `types` | The types of activity that will trigger a workflow run. | `opened`, `assigned`, `edited` |
6969
| `project` | The name of the project | `Backlog` |
7070
| `column` | The column to create or move the card to | `Triage` |
7171
| `repo-token` | The personal access token | `${{ secrets.GITHUB_TOKEN }}` |

__tests__/get-action-data.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,5 +190,5 @@ test('getActionData should fail when eventName is not issues or pull_request', t
190190

191191
const error = t.throws(() => getActionData(failingMockGithubContext));
192192

193-
t.is(error.message, `Only pull requests or issues allowed, received:\n${eventName}`);
193+
t.is(error.message, `Only pull requests, issues or comments allowed, received:\n${eventName}`);
194194
});

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/get-action-data.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
*/
66
const getActionData = githubContext => {
77
const {eventName, payload} = githubContext;
8-
if (eventName !== 'pull_request' && eventName !== 'pull_request_target' && eventName !== 'issues') {
9-
throw new Error(`Only pull requests or issues allowed, received:\n${eventName}`);
8+
if (eventName !== 'pull_request' && eventName !== 'pull_request_target' && eventName !== 'issues' && eventName !== 'issue_comment') {
9+
throw new Error(`Only pull requests, issues or comments allowed, received:\n${eventName}`);
1010
}
1111

1212
const githubData = eventName === 'issues' ?

0 commit comments

Comments
 (0)