Skip to content

Commit

Permalink
feat(action): allow processing issue_comment event (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
jurijzahn8019 authored Dec 10, 2020
1 parent 92abc49 commit e61f896
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ Change these options in the workflow `.yml` file to meet your GitHub project nee

| Setting | Description | Values |
| --- | --- | --- |
| `on` | When the automation is ran | `issues` `pull_request` |
| `types` | The types of activity that will trigger a workflow run. | `opened`, `assigned` |
| `on` | When the automation is ran | `issues` `pull_request` `issue_comment` |
| `types` | The types of activity that will trigger a workflow run. | `opened`, `assigned`, `edited` |
| `project` | The name of the project | `Backlog` |
| `column` | The column to create or move the card to | `Triage` |
| `repo-token` | The personal access token | `${{ secrets.GITHUB_TOKEN }}` |
Expand Down
2 changes: 1 addition & 1 deletion __tests__/get-action-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,5 +190,5 @@ test('getActionData should fail when eventName is not issues or pull_request', t

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

t.is(error.message, `Only pull requests or issues allowed, received:\n${eventName}`);
t.is(error.message, `Only pull requests, issues or comments allowed, received:\n${eventName}`);
});
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/get-action-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
*/
const getActionData = githubContext => {
const {eventName, payload} = githubContext;
if (eventName !== 'pull_request' && eventName !== 'pull_request_target' && eventName !== 'issues') {
throw new Error(`Only pull requests or issues allowed, received:\n${eventName}`);
if (eventName !== 'pull_request' && eventName !== 'pull_request_target' && eventName !== 'issues' && eventName !== 'issue_comment') {
throw new Error(`Only pull requests, issues or comments allowed, received:\n${eventName}`);
}

const githubData = eventName === 'issues' ?
Expand Down

0 comments on commit e61f896

Please sign in to comment.