Skip to content

Commit

Permalink
fix(notify): bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Airkro committed Dec 15, 2023
1 parent ae76298 commit 9b7b493
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 15 deletions.
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bring-it/cli",
"version": "0.8.0",
"version": "0.8.1",
"description": "Common command line interface of 'bring-it'",
"license": "MIT",
"author": {
Expand Down
4 changes: 2 additions & 2 deletions packages/notify/lib/action.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ export async function action({ mode }) {

dingtalk({
markdown: createContent(all),
title: all.project || 'bring-it',
title: all.project || '版本发布通知',
token: DingTalkRobotToken,
})
.then((resp) => {
logger.okay(resp.status);
logger.okay(resp);
})
.catch((error) => {
console.error(error);
Expand Down
26 changes: 20 additions & 6 deletions packages/notify/lib/utils.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,36 @@ export function dingtalk({ markdown, title, token }) {
});
}

export function createContent({ project = '未命名项目', type, manual = true }) {
export function createContent({
project = '未命名项目',
type,
manual = true,
banner,
}) {
return toMarkdown({
type: 'root',
children: [
CCI_JOB_NAME
banner
? {
type: 'heading',
depth: 3,
type: 'paragraph',
children: [
{
type: 'text',
value: CCI_JOB_NAME,
type: 'image',
url: banner,
},
],
}
: undefined,
{
type: 'heading',
depth: 3,
children: [
{
type: 'text',
value: CCI_JOB_NAME || '自动化任务',
},
],
},
{
type: 'paragraph',
children: [
Expand Down
2 changes: 1 addition & 1 deletion packages/notify/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bring-it/notify",
"version": "0.1.2",
"version": "0.1.3",
"description": "Send releases notifications",
"license": "MIT",
"author": {
Expand Down
2 changes: 1 addition & 1 deletion packages/npm/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bring-it/npm",
"version": "0.4.0",
"version": "0.4.1",
"description": "Publish npm packages when needed",
"license": "MIT",
"author": {
Expand Down
2 changes: 1 addition & 1 deletion packages/sample/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bring-it/sample",
"version": "0.3.0",
"version": "0.3.1",
"description": "Generate code sample files",
"license": "MIT",
"author": {
Expand Down
2 changes: 1 addition & 1 deletion packages/sentry/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bring-it/sentry",
"version": "0.3.0",
"version": "0.3.1",
"description": "Update sentry artifacts",
"license": "MIT",
"author": {
Expand Down
2 changes: 1 addition & 1 deletion packages/sftp/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bring-it/sftp",
"version": "0.2.0",
"version": "0.2.1",
"description": "SFTP deployment tool for frontend",
"license": "MIT",
"author": {
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,5 @@ export function http({ url, query, json, method = 'GET' }) {
'Content-Type': 'application/json',
},
body: JSON.stringify(json),
});
}).then((response) => response.json());
}

0 comments on commit 9b7b493

Please sign in to comment.