tranz-commit-icafe-close
Version:
根据 commit message 自动关闭 icafe 卡片
78 lines (50 loc) • 1.58 kB
Markdown
# `tranz-commit-icafe-close`
> 分析 commit message,修改关联的卡片状态
## Usage
```javascript
const tranz = require('tranz').default
const tranzCommitIcafeClose = require('tranz-commit-icafe-close')
tranz(['feat: 修复 bug #99', 'closed #111 icafe-api-ok-123'].join('\n'), [
tranzCommitIcafeClose({ spaceId: 'icafe-api', username: 'xxx', password: 'yyy' })
]).then(output => {
// 将会修改 icafe-api-111 和 icafe-api-ok-123 卡片的状态
// #99 则不会被处理
})
```
### Options
##### `stateName`
修改卡片至什么状态。
当类型为 `object` 时,如
```js
{
stateName: {
'Bug': "已解决",
"任务": "PM待验收",
"$fallback": "进行中"
}
}
```
表示:类型为 Bug 的卡片,状态更改至 "已解决",任务 则更改至 "PM 待验收",`$fallback` 则表示其他类型的状态
- type: `string|object`
- default: `'开发中'`
##### `debug`
打印调试信息
- type: `boolean`
- default: `false`
##### `silent`
不 log 任何信息
- type: `boolean`
- default: `false`
#### **注意:以下选项不存在时,将会向上读取 `package.json` 中的 `icafe` 字段获取**
##### `spaceId`
当遇到 `#123` 卡片缩写时,将会修改卡片 `{spaceId}-123` 状态
- type: `string`
- default: `undefined`
##### `username`
icafe username,详见[icafe-api](http://gitlab.baidu.com/be-fe/icafe-api)
- type: `string`
- default: `undefined`
##### `password`
icafe 虚拟密码,详见[icafe-api](http://gitlab.baidu.com/be-fe/icafe-api)
- type: `string`
- default: `undefined`