Skip to content

Commit

Permalink
fix: Extend checks supported events
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.
  • Loading branch information
jeremieguichard committed Mar 7, 2023
1 parent 903d5e8 commit c0e54f6
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 9 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'
1 change: 1 addition & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
CHANGELOG
=====================================
| February 27, 2023: fix: Extend checks supported events `#700 <https://github.com/mergeability/mergeable/pull/700>`_
| February 03, 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>`_
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 c0e54f6

Please sign in to comment.