diff --git a/package-lock.json b/package-lock.json index 58b1fcf..315c729 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6571,7 +6571,7 @@ }, "packages/notify": { "name": "@bring-it/notify", - "version": "0.0.0", + "version": "0.1.1", "license": "MIT", "engines": { "node": "^18.0.0 || ^20.0.0", diff --git a/packages/notify/lib/action.mjs b/packages/notify/lib/action.mjs index 78de92e..896f668 100644 --- a/packages/notify/lib/action.mjs +++ b/packages/notify/lib/action.mjs @@ -34,7 +34,7 @@ export async function action({ mode }) { dingtalk({ markdown: createContent(all), - title: project, + title: all.project || 'bring-it', token: DingTalkRobotToken, }) .then(console.log) diff --git a/packages/notify/lib/utils.mjs b/packages/notify/lib/utils.mjs index c9f8933..af2c5bb 100644 --- a/packages/notify/lib/utils.mjs +++ b/packages/notify/lib/utils.mjs @@ -32,13 +32,13 @@ export function dingtalk({ markdown, title, token }) { }); } -export function createContent({ description, type }) { +export function createContent({ project = '未命名项目', type }) { return ` ### ${CCI_JOB_NAME} [${PROJECT_NAME}](${PROJECT_WEB_URL}) 发布了新的版本 -- 所属项目:${description} +- 所属项目:${project} - 发布类型:${type} - 版本编号:${npm_package_version} diff --git a/packages/notify/package.json b/packages/notify/package.json index d268742..82cac11 100644 --- a/packages/notify/package.json +++ b/packages/notify/package.json @@ -1,6 +1,6 @@ { "name": "@bring-it/notify", - "version": "0.0.0", + "version": "0.1.1", "description": "Send releases notifications", "license": "MIT", "author": { diff --git a/packages/utils/index.mjs b/packages/utils/index.mjs index eb207ca..bde3ede 100644 --- a/packages/utils/index.mjs +++ b/packages/utils/index.mjs @@ -78,7 +78,7 @@ export function http({ url, query, json, method = 'GET' }) { const io = new URL(url); for (const [key, value] of Object.entries(query)) { - url.searchParams.set(key, value); + io.searchParams.set(key, value); } return fetch(io.href, {