Skip to content

Commit

Permalink
Auto-stage upgrade guide and readme (in addition to changelog)
Browse files Browse the repository at this point in the history
  • Loading branch information
vweevers committed Jun 9, 2021
1 parent f7167c1 commit 743d94f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,7 @@ function dirtyWorkingTrees (updater, roots, done) {
const dirtyLines = []

for (const { x, y, from, to } of statusObjects) {
// Allow changelog to be committed together with version
if (isChangelog(to)) {
if (autoStage(to)) {
updater[kLog]('Stage %s', to)

if (!updater.dryRun) {
Expand Down Expand Up @@ -238,8 +237,9 @@ function dirtyWorkingTrees (updater, roots, done) {
}
}

function isChangelog (file) {
return /^(CHANGELOG|CHANGES|HISTORY)\.(md|markdown)$/i.test(file)
function autoStage (file) {
// Allow changelog, upgrade guide and readme to be committed together with version
return /^(CHANGELOG|CHANGES|HISTORY|UPGRADING|README)\.(md|markdown)$/i.test(file)
}

function readFiles (files, done) {
Expand Down

0 comments on commit 743d94f

Please sign in to comment.