Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/p-m-p/cz-conventional-changelog-coauthors

cz-conventional-changelog with additional co-authors prompt
https://github.com/p-m-p/cz-conventional-changelog-coauthors

co-authors commitizen conventional-changelog conventional-commits git

Last synced: 5 days ago
JSON representation

cz-conventional-changelog with additional co-authors prompt

Awesome Lists containing this project

README

        

# cz-conventional-changelog-coauthors

[![npm version](https://img.shields.io/npm/v/cz-conventional-changelog-coauthors.svg?style=flat-square)](https://www.npmjs.org/package/cz-conventional-changelog-coauthors)

A simple wrapper around [cz-conventional-changelog](https://github.com/commitizen/cz-conventional-changelog) to provide an addition `Co-authored-by` prompt for teams that use pair/mob programming and wish to attribute additional authors to a commit.

## Installation

Make your repository [commitizen friendly](https://github.com/commitizen/cz-cli#making-your-repo-commitizen-friendly) using the commitizen cli.

```sh
# npm
commitizen init cz-conventional-changelog-coauthors --save-dev --save-exact

# yarn
commitizen init cz-conventional-changelog-coauthors --yarn --dev --exact

# pnpm
commitizen init cz-conventional-changelog-coauthors --pnpm --save-dev --save-exact
```

## Configuration

### package.json

See [cz-conventional-changelog](https://github.com/commitizen/cz-conventional-changelog#configuration) for a full list of configuration options. Co-authors can be provided in the `defaultCoAuthors` option as list of raw strings or objects with name and email fields.

```json
{
"config": {
"commitizen": {
"path": "./node_modules/cz-conventional-changelog-coauthors",
"defaultCoAuthors": [
"Joe Bloggs ",
{
"name": "Jane Doe",
"email": "[email protected]"
}
]
}
}
}
```

You can also install and configure the adapter globally in `~/.czrc`

```json
{
"path": "cz-conventional-changelog-coauthors",
"defaultCoAuthors": [
{
"name": "Jane Doe",
"email": "[email protected]"
},
{
"name": "Joe Bloggs",
"email": "[email protected]"
}
]
}
```

### Environment variable

As with the environment variables for [cz-conventional-changelog](https://github.com/commitizen/cz-conventional-changelog#environment-variables) the co-author list can be provideed in the `CZ_CO_AUTHORS` environment variable. The environment variable overrides the `defaultCoAuthors` configuration option and can be used to populate the author list dynamically.

```sh
export CZ_CO_AUTHORS = "Joe Bloggs , Jane Doe "
```