-
Notifications
You must be signed in to change notification settings - Fork 0
/
workflow.config.js
44 lines (42 loc) · 1.13 KB
/
workflow.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// eslint-disable-next-line import/no-extraneous-dependencies
import 'dotenv/config';
/**
* @typedef {import("./types/index").WorkFlowConfig} WorkFlowConfig
*/
/**
* @type {WorkFlowConfig}
*/
const config = {
// {version}-{env}-{order}
tag: {
getEnv: ({ branchName }) => {
if (branchName === 'master') {
return 'prod';
}
return 'dev';
},
getMsg: ({ tagName }) => `🔖 ${tagName}`,
getVersionFileName: ({ branchName }) => {
if (branchName !== 'master') {
return 'VERSION.DEV';
}
return 'VERSION';
},
getFirstTagName: ({ branchName }) => {
if (branchName === 'master') {
return '1.0.0-prod-1';
}
return '1.0.0-dev-1';
},
allowBranchs: ['master', 'dev', 'test'],
},
notify: {
getWebhookUrl: () => process.env.WEBHOOK_URL,
getContent: ({ username, tagName }) => `前端项目正式环境更新。\n
>项目:<font color="comment">项目名字</font>
>执行人:<font color="comment">${username}</font>
>TAG:<font color="comment">${tagName}</font>`,
allowBranchs: ['master'],
},
};
export default config;