From 741172fd98cf68338e5f8c47037a8e3f48c88df2 Mon Sep 17 00:00:00 2001 From: xiaojunnuo Date: Wed, 24 Jul 2024 02:16:12 +0800 Subject: [PATCH] chore: --- package.json | 2 +- packages/core/acme-client/build.md | 2 +- publish-check.js | 7 +++++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index eef2facd..01bc98b4 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "publish": "npm run prepublishOnly1 && lerna publish --conventional-commits --create-release github && npm run afterpublishOnly && npm run deploy1", "afterpublishOnly": "", "prepublishOnly1": "npm run check && npm run before-build && lerna run build ", - "before-build": "cd ./packages/core/acme-client && time /t >build.md && git add build.trigger && git commit -m \\\"build: prepare to build\\\"", + "before-build": "cd ./packages/core/acme-client && time /t >build.md && git add . && git commit -m \\\"build: prepare to build\\\"", "deploy1": "node --experimental-json-modules deploy.js ", "check": "node --experimental-json-modules publish-check.js", "init": "lerna run build" diff --git a/packages/core/acme-client/build.md b/packages/core/acme-client/build.md index 12524293..e9dc6ed7 100644 --- a/packages/core/acme-client/build.md +++ b/packages/core/acme-client/build.md @@ -1 +1 @@ -03:10 +02:16 diff --git a/publish-check.js b/publish-check.js index 5592dec0..dfb4650d 100644 --- a/publish-check.js +++ b/publish-check.js @@ -1,5 +1,6 @@ import fs from 'fs' +import childProcess from 'child_process'; function check(){ const gitAdd = fs.readFileSync("./node_modules/@lerna-lite/version/dist/lib/git-add.js","utf-8") if(gitAdd.indexOf("('git', ['add', '.']") > -1){ @@ -10,7 +11,13 @@ function check(){ } //GH_TOKEN + console.log("检查 GH_TOKEN") + if(process.env.npm_config_gh_token){ + process.env.GH_TOKEN = process.env.npm_config_gh_token + childProcess.exec("set GH_TOKEN="+process.env.npm_config_gh_token) + } if(!process.env.GH_TOKEN){ + console.log(process.env) console.error("GH_TOKEN 未设置") throw new Error("GH_TOKEN 未设置") }