absolute-version / commit-and-tag-version

Fork of the excellent standard-version. Automate versioning and CHANGELOG generation, with semver.org and conventionalcommits.org :trophy:
ISC License
385 stars 36 forks source link

feat: option to push automatically #78

Closed ppodevlabs closed 1 year ago

ppodevlabs commented 1 year ago

In order to integrate with CI environments it would be nice if there is an option to push automatically the tags and changelog generated so we do not have to do extra steps to push the information.

oowais commented 1 year ago

Please correct me if I understood wrong. In the configuration, you can use the lifecycle scripts and one those that might satisfy your usecase could be

  "scripts": {
    "posttag": "git push origin main"
  },

Ref: Lifecycle scripts

TimothyJones commented 1 year ago

Yes, I think the lifecycle script is the way to go here.

Note that the scripts block there is different to the npm scripts block - it should go inside the commit-and-tag-version stanza:

// package.json
{
 ....
  "commit-and-tag-version": {
      "scripts": {
        "posttag": "git push origin main"
      }
  }
}
TimothyJones commented 1 year ago

I'll close this as I think the lifecycle scripts support this use case - feel free to reopen if they don't work for you.

bytelabsco commented 5 months ago

@TimothyJones - when using the scripts, does it support any sort of variable interpolation? I'd like to run something like this to push the commit & tag simultaneiously

git push --atomic origin main <tag-that-was-just-created>

TimothyJones commented 5 months ago

I don’t think so, but it would be pretty easy to (eg) check the most recent tag and do this