From 981c704e0a9e5cdbb9ad592682779889c67e222d Mon Sep 17 00:00:00 2001 From: Steve Mao Date: Fri, 17 Jul 2015 22:12:32 +1000 Subject: [PATCH] feat(prerelease): auto detect based on semver --- index.js | 6 +++++- package.json | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 6a52c0f3..016ced69 100644 --- a/index.js +++ b/index.js @@ -4,6 +4,7 @@ var dateFormat = require('dateformat'); var Github = require('github'); var merge = require('lodash.merge'); var Q = require('q'); +var semver = require('semver'); var through = require('through2'); var github = new Github({ @@ -83,12 +84,15 @@ function conventionalGithubReleaser(auth, changelogOpts, context, gitRawCommitsO return; } + var prerelease = semver.parse(version).prerelease.length > 0; + var promise = Q.nfcall(github.releases.createRelease, { // jscs:disable owner: context.owner, repo: context.repository, tag_name: version, - body: chunk.log + body: chunk.log, + prerelease: prerelease // jscs:enable }); diff --git a/package.json b/package.json index a47ff806..5486b1c7 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,7 @@ "lodash.merge": "^3.3.2", "meow": "^3.3.0", "q": "^1.4.1", + "semver": "^5.0.1", "through2": "^2.0.0" }, "devDependencies": {