Socket
Socket
Sign inDemoInstall

@holidaycheck/liam-tasks

Package Overview
Dependencies
Maintainers
5
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@holidaycheck/liam-tasks - npm Package Compare versions

Comparing version 1.1.2 to 1.2.0

4

docs/auto-merge-pull-request.md

@@ -28,3 +28,3 @@ # Task `auto-merge-pull-request`

* **What is this `mergeable_state` field in pull request response? I cannot find this in API docs
* What is this `mergeable_state` field in pull request response? I cannot find this in API docs

@@ -41,2 +41,2 @@ This value is undocumented, here's the excerpt from GitHub Support:

Basically, we're interested only in `mergeable_state === clean`
Basically, we're interested only in `mergeable_state === clean|unstable`
{
"name": "@holidaycheck/liam-tasks",
"version": "1.1.2",
"version": "1.2.0",
"description": "Set of automation tasks for `liam`",

@@ -5,0 +5,0 @@ "repository": "https://github.com/holidaycheck/liam-tasks",

@@ -67,3 +67,3 @@ const R = require('ramda');

.then((pullRequestData) => {
if (pullRequestData.mergeable_state === 'clean') {
if (pullRequestData.mergeable_state.match(/^(clean|unstable)$/)) {
return mergePullRequest(githubClient, repository, pullRequestData)

@@ -70,0 +70,0 @@ .then(commentOnPullRequest.bind(null, githubClient, label, repository))

@@ -29,3 +29,3 @@ const expect = require('chai').expect;

it('should merge pull request that fulfils merge criteria', () => {
it('should merge pull request with status "clean"', () => {
const logger = createLogger();

@@ -82,2 +82,26 @@ const repository = { owner: 'foo', name: 'bar' };

it('should merge pull request with status "unstable"', () => {
const logger = createLogger();
const repository = { owner: 'foo', name: 'bar' };
const label = 'merge-me-please';
const githubClient = createGithubClient();
githubClient.gitdata.deleteReference.resolves();
githubClient.issues.createComment.resolves();
githubClient.pullRequests.get.resolves({ data: {
head: { ref: 'feature-branch' },
mergeable_state: 'unstable'
} });
githubClient.pullRequests.merge.resolves();
githubClient.search.issues.resolves({ data: { items: [ { number: 1337 } ] } });
return autoMergePullRequest(logger, { githubClient, label, repository }).then(() => {
expect(githubClient.search.issues).to.have.been.calledOnce;
expect(githubClient.pullRequests.get).to.have.been.calledOnce;
expect(githubClient.pullRequests.merge).to.have.been.calledOnce;
expect(githubClient.issues.createComment).to.have.been.calledOnce;
expect(githubClient.gitdata.deleteReference).to.have.been.calledOnce;
expect(logger.log).to.have.been.calledOnce;
});
});
it('should not merge anything when there\'s no matching pull request found', () => {

@@ -129,3 +153,3 @@ const logger = createLogger();

it('should not try to merge non-mergeable pull request', () => {
const ignoredStates = [ 'dirty', 'unknown', 'blocked', 'behind', 'unstable', 'has_hooks', 'foobar' ];
const ignoredStates = [ 'dirty', 'unknown', 'blocked', 'behind', 'has_hooks', 'foobar' ];
const createTestCaseForMergeableState = (state) => {

@@ -132,0 +156,0 @@ const logger = createLogger();

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc