Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix undefined error with blank validators #404

Merged
merged 2 commits into from
Oct 7, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
CHANGELOG
=====================================

| October 6, 2020 : fix: Fix undefined error with blank validators `#402 <https://github.com/mergeability/mergeable/issues/402>`_
| October 4, 2020 : fix Typo in header of title validator docs
| October 2, 2020 : Don't throw merge error if required status are are the cause of the error `#389 <https://github.com/mergeability/mergeable/issues/389>`_
| September 24, 2020 : Add ability to delete or replace the labels on an issue `#380 <https://github.com/mergeability/mergeable/issues/380>`_
Expand Down
17 changes: 17 additions & 0 deletions docs/recipes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,20 @@ Detect issues and pull requests that are n days old (stale) and notify authors a
payload:
body: This is old. Is it still relevant?


Greet a new contributor
"""""""""""""""""""""""
Add a comment on a pull request when it is created

::

version: 2
mergeable:
- when: pull_request.opened
name: "Greet a contributor"
validate: []
pass:
- do: comment
payload:
body: >
Thanks for creating a pull request! A maintainer will review your changes shortly. Please don't be discouraged if it takes a while.
2 changes: 1 addition & 1 deletion lib/actions/close.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Close extends Action {
async beforeValidate () {}

async afterValidate (context, settings, name, results) {
let scheduleResults = results && results.validationSuites && results.validationSuites[0].schedule
let scheduleResults = results && results.validationSuites && results.validationSuites.length && results.validationSuites[0].schedule
let items = (scheduleResults)
? scheduleResults.issues.concat(scheduleResults.pulls)
: [this.getPayload(context)]
Expand Down
2 changes: 1 addition & 1 deletion lib/actions/comment.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class Comment extends Action {
async beforeValidate () {}

async afterValidate (context, settings, name, results) {
let scheduleResults = results && results.validationSuites && results.validationSuites[0].schedule
let scheduleResults = results && results.validationSuites && results.validationSuites.length && results.validationSuites[0].schedule
let commentables = (scheduleResults)
? scheduleResults.issues.concat(scheduleResults.pulls)
: [this.getPayload(context)]
Expand Down
2 changes: 1 addition & 1 deletion lib/actions/labels.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class Labels extends Action {
async beforeValidate () {}

async afterValidate (context, settings, name, results) {
let scheduleResults = results && results.validationSuites && results.validationSuites[0].schedule
let scheduleResults = results && results.validationSuites && results.validationSuites.length && results.validationSuites[0].schedule
let items = (scheduleResults)
? scheduleResults.issues.concat(scheduleResults.pulls)
: [this.getPayload(context)]
Expand Down