Skip to content

Commit

Permalink
fix: Extend checks supported events (#700)
Browse files Browse the repository at this point in the history
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 <aungshine@gmail.com>
  • Loading branch information
jeremieguichard and shine2lay committed Mar 7, 2023
1 parent 5aaecd0 commit 1245619
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 10 deletions.
5 changes: 4 additions & 1 deletion docs/actions/check.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ You can pass in Handlebars template to show the details result of the run.
checks will automatically re-run if the base branch has a modified config file

Supported Events:

The `pull_request.closed` event is not supported since it does not have meaningful use in the context of GitHub check API.

::

'pull_request.*', 'pull_request_review.*'
'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'
3 changes: 2 additions & 1 deletion docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
CHANGELOG
=====================================
| March 7, 2023: fix: Extend checks supported events `#700 <https://github.com/mergeability/mergeable/pull/700>`_
| March 1, 2023: feat:Added user information for commit validator `#682 <https://github.com/mergeability/mergeable/pull/682>`_
| February 03, 2023: feat: Add team option to author filter `#696 <https://github.com/mergeability/mergeable/pull/696>`_
| February 3, 2023: feat: Add team option to author filter `#696 <https://github.com/mergeability/mergeable/pull/696>`_
| February 3, 2023: chore: Update node version for release workflow `#699 <https://github.com/mergeability/mergeable/pull/699>`_
| February 3, 2023: feat: Add Not operator `#695 <https://github.com/mergeability/mergeable/pull/695>`_
| September 28, 2022: feat: Add last comment validator `#668 <https://github.com/mergeability/mergeable/pull/668>`_
Expand Down
32 changes: 24 additions & 8 deletions lib/actions/checks.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,20 +63,36 @@ const updateParams = ({ context, id, name, status, output, conclusion }) => {
class Checks extends Action {
constructor () {
super('checks')

// Support for 'pull_request.closed' event was not enabled since
// it does not have meaningful use in the context of GitHub
// check API: there is no reason to post a check result on a
// pull request that is actually closed.
this.supportedEvents = [
'pull_request.opened',
'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_review.submitted',
'pull_request_review.edited',
'pull_request_review.dismissed',
'pull_request.enqueued',
'pull_request.labeled',
'pull_request.locked',
'pull_request.milestoned',
'pull_request.demilestoned',
'pull_request.assigned',
'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.synchronize',
'pull_request.push_synchronize'
'pull_request.unlocked',
'pull_request_review.dismissed',
'pull_request_review.edited',
'pull_request_review.submitted'
]
this.checkRunResult = new Map()
}
Expand Down

0 comments on commit 1245619

Please sign in to comment.