Standard-version: Update README.md or any other file with release commit

Created on 18 Apr 2019  路  2Comments  路  Source: conventional-changelog/standard-version

I'd like to update my README.md file on release (just like I can do with CHANGELOG.md).

  "standard-version": {
    "scripts": {
      "postchangelog": "replace '/pattern-x/' '/pattern-y/' CHANGELOG.md && node scripts/sync-badges.js && git add ."
    }
  }

The postchangelog modifes files, but README.md doesn't get included in the release commit.
Tried to use postbump, precommit with same result.


I'm opening another issue since https://github.com/conventional-changelog/standard-version/issues/247 was closed without a solution.

enhancement

Most helpful comment

I've managed to achieve this with the postcommit hook. I add the files, and amend the commit with a no-edit flag.

What I'm doing:

"standard-version": {
    "scripts": {
      "postcommit": "git add README.md && git commit --amend --no-edit"
    }
}

All 2 comments

@buz-zard this seems like a reasonable additional to functionality 馃憤 definitely open to a PR.

I've managed to achieve this with the postcommit hook. I add the files, and amend the commit with a no-edit flag.

What I'm doing:

"standard-version": {
    "scripts": {
      "postcommit": "git add README.md && git commit --amend --no-edit"
    }
}
Was this page helpful?
0 / 5 - 0 ratings