Skip to content

Commit

Permalink
feat(prerelease): auto detect based on semver
Browse files Browse the repository at this point in the history
  • Loading branch information
stevemao committed Jul 17, 2015
1 parent 83f0d10 commit 981c704
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down Expand Up @@ -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
});

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down

0 comments on commit 981c704

Please sign in to comment.