Skip to content

Commit 1245619

Browse files
fix: Extend checks supported events (#700)
The checks action should be able to support most pull_request and pull_request_review events. Only the `pull_request.closed` event is not enabled since it does not have meaningful use in the context of the GitHub checks API. Co-authored-by: Shine Lee <[email protected]>
1 parent 5aaecd0 commit 1245619

File tree

3 files changed

+30
-10
lines changed

3 files changed

+30
-10
lines changed

docs/actions/check.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ You can pass in Handlebars template to show the details result of the run.
6969
checks will automatically re-run if the base branch has a modified config file
7070

7171
Supported Events:
72+
73+
The `pull_request.closed` event is not supported since it does not have meaningful use in the context of GitHub check API.
74+
7275
::
7376

74-
'pull_request.*', 'pull_request_review.*'
77+
'pull_request.assigned', 'pull_request.auto_merge_disabled', 'pull_request.auto_merge_enabled', 'pull_request.converted_to_draft', 'pull_request.demilestoned', 'pull_request.dequeued', 'pull_request.edited', 'pull_request.enqueued', 'pull_request.labeled', 'pull_request.locked', 'pull_request.milestoned', 'pull_request.opened', 'pull_request.push_synchronize', 'pull_request.ready_for_review', 'pull_request.reopened', 'pull_request.review_request_removed', 'pull_request.review_requested', 'pull_request.synchronize', 'pull_request.unassigned', 'pull_request.unlabeled', 'pull_request.unlocked', 'pull_request_review.dismissed', 'pull_request_review.edited', 'pull_request_review.submitted'

docs/changelog.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
CHANGELOG
22
=====================================
3+
| March 7, 2023: fix: Extend checks supported events `#700 <https://github.com/mergeability/mergeable/pull/700>`_
34
| March 1, 2023: feat:Added user information for commit validator `#682 <https://github.com/mergeability/mergeable/pull/682>`_
4-
| February 03, 2023: feat: Add team option to author filter `#696 <https://github.com/mergeability/mergeable/pull/696>`_
5+
| February 3, 2023: feat: Add team option to author filter `#696 <https://github.com/mergeability/mergeable/pull/696>`_
56
| February 3, 2023: chore: Update node version for release workflow `#699 <https://github.com/mergeability/mergeable/pull/699>`_
67
| February 3, 2023: feat: Add Not operator `#695 <https://github.com/mergeability/mergeable/pull/695>`_
78
| September 28, 2022: feat: Add last comment validator `#668 <https://github.com/mergeability/mergeable/pull/668>`_

lib/actions/checks.js

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,20 +63,36 @@ const updateParams = ({ context, id, name, status, output, conclusion }) => {
6363
class Checks extends Action {
6464
constructor () {
6565
super('checks')
66+
67+
// Support for 'pull_request.closed' event was not enabled since
68+
// it does not have meaningful use in the context of GitHub
69+
// check API: there is no reason to post a check result on a
70+
// pull request that is actually closed.
6671
this.supportedEvents = [
67-
'pull_request.opened',
72+
'pull_request.assigned',
73+
'pull_request.auto_merge_disabled',
74+
'pull_request.auto_merge_enabled',
75+
'pull_request.converted_to_draft',
76+
'pull_request.demilestoned',
77+
'pull_request.dequeued',
6878
'pull_request.edited',
69-
'pull_request_review.submitted',
70-
'pull_request_review.edited',
71-
'pull_request_review.dismissed',
79+
'pull_request.enqueued',
7280
'pull_request.labeled',
81+
'pull_request.locked',
7382
'pull_request.milestoned',
74-
'pull_request.demilestoned',
75-
'pull_request.assigned',
83+
'pull_request.opened',
84+
'pull_request.push_synchronize',
85+
'pull_request.ready_for_review',
86+
'pull_request.reopened',
87+
'pull_request.review_request_removed',
88+
'pull_request.review_requested',
89+
'pull_request.synchronize',
7690
'pull_request.unassigned',
7791
'pull_request.unlabeled',
78-
'pull_request.synchronize',
79-
'pull_request.push_synchronize'
92+
'pull_request.unlocked',
93+
'pull_request_review.dismissed',
94+
'pull_request_review.edited',
95+
'pull_request_review.submitted'
8096
]
8197
this.checkRunResult = new Map()
8298
}

0 commit comments

Comments
 (0)