mirror of
https://github.com/beilunyang/moemail.git
synced 2026-07-09 22:51:23 +08:00
fix: Breaking update due to new deployment scripts
This commit is contained in:
@@ -258,6 +258,17 @@ const checkAndCreatePages = async () => {
|
|||||||
*/
|
*/
|
||||||
const pushPagesSecret = () => {
|
const pushPagesSecret = () => {
|
||||||
console.log("🔐 Pushing environment secrets to Pages...");
|
console.log("🔐 Pushing environment secrets to Pages...");
|
||||||
|
|
||||||
|
// 定义运行时所需的环境变量列表
|
||||||
|
const runtimeEnvVars = ['AUTH_GITHUB_ID', 'AUTH_GITHUB_SECRET', 'AUTH_SECRET'];
|
||||||
|
|
||||||
|
// 兼容老的部署方式,如果这些环境变量不存在,则说明是老的部署方式,跳过推送
|
||||||
|
for (const varName of runtimeEnvVars) {
|
||||||
|
if (!process.env[varName]) {
|
||||||
|
console.log(`🔐 Skipping pushing secrets to Pages...`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// 确保.env文件存在
|
// 确保.env文件存在
|
||||||
@@ -269,9 +280,6 @@ const pushPagesSecret = () => {
|
|||||||
const envContent = readFileSync(resolve('.env'), 'utf-8');
|
const envContent = readFileSync(resolve('.env'), 'utf-8');
|
||||||
const runtimeEnvFile = resolve('.env.runtime');
|
const runtimeEnvFile = resolve('.env.runtime');
|
||||||
|
|
||||||
// 定义运行时所需的环境变量列表
|
|
||||||
const runtimeEnvVars = ['AUTH_GITHUB_ID', 'AUTH_GITHUB_SECRET', 'AUTH_SECRET'];
|
|
||||||
|
|
||||||
// 从.env文件中提取运行时变量
|
// 从.env文件中提取运行时变量
|
||||||
const runtimeEnvContent = envContent
|
const runtimeEnvContent = envContent
|
||||||
.split('\n')
|
.split('\n')
|
||||||
|
|||||||
Reference in New Issue
Block a user