Skip to content

AI-native knowledge base & Evernote/Obsidian alternative with instant sync & native MCP. Free on Cloudflare or self-hosted via Docker.

fix(deploy): make manual updates redeploy

tianma-if3fef2c7a1de8
diff --git a/.github/workflows/sync-edgeever-upstream.yml b/.github/workflows/sync-edgeever-upstream.yml
index ea9fbd7a..15bc1340 100644
--- a/.github/workflows/sync-edgeever-upstream.yml
+++ b/.github/workflows/sync-edgeever-upstream.yml
@@ -18,12 +18,6 @@ on:
options:
- stable
- edge
- force_redeploy:
- description: When already on the target version, push an empty commit so Cloudflare Builds runs again
- required: false
- default: false
- type: boolean
-
permissions:
contents: write
issues: write
@@ -35,14 +29,16 @@ concurrency:
jobs:
update:
if: github.repository != 'tianma-if/edgeever'
- name: Align and publish upstream
+ name: Sync Fork and trigger deployment
runs-on: ubuntu-latest
timeout-minutes: 20
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
UPSTREAM_REPOSITORY: tianma-if/edgeever
UPDATE_CHANNEL: ${{ inputs.channel || vars.EDGE_EVER_UPDATE_CHANNEL || 'stable' }}
- FORCE_REDEPLOY: ${{ inputs.force_redeploy || false }}
+ # A manual run is an explicit request to publish the selected version.
+ # Scheduled checks remain no-op when the Fork is already aligned.
+ FORCE_REDEPLOY: ${{ github.event_name == 'workflow_dispatch' }}
PRESERVE_FORK_CHANGES: ${{ vars.EDGE_EVER_PRESERVE_FORK_CHANGES || 'false' }}
steps:
@@ -160,15 +156,15 @@ jobs:
} >> "${GITHUB_OUTPUT}"
{
- echo "### EdgeEver upstream sync"
+ echo "### EdgeEver update / EdgeEver 更新"
echo ""
- echo "| Field | Value |"
+ echo "| Field / 字段 | Value / 值 |"
echo "| --- | --- |"
- echo "| Channel | \`${UPDATE_CHANNEL}\` |"
- echo "| Fork mode | \`${fork_mode}\` |"
- echo "| Upstream target | \`${target_ref}\` (\`${target_commit:0:12}\`, v${target_version}) |"
- echo "| Fork main before | \`${head_commit:0:12}\` (v${head_version}) |"
- echo "| Decision | \`${reason}\` / align=\`${align_mode}\` / update=\`${update_required}\` / republish=\`${republish_only}\` |"
+ echo "| Channel / 更新通道 | \`${UPDATE_CHANNEL}\` |"
+ echo "| Fork mode / Fork 模式 | \`${fork_mode}\` |"
+ echo "| Upstream target / 上游目标 | \`${target_ref}\` (\`${target_commit:0:12}\`, v${target_version}) |"
+ echo "| Fork main before / 更新前 | \`${head_commit:0:12}\` (v${head_version}) |"
+ echo "| Decision / 判定 | \`${reason}\` / align=\`${align_mode}\` / update=\`${update_required}\` / republish=\`${republish_only}\` |"
echo ""
case "${reason}" in
already_on_target)
@@ -198,12 +194,20 @@ jobs:
esac
if [ "${republish_only}" = "true" ]; then
echo ""
- echo "\`force_redeploy\` is set: will push an empty commit so Cloudflare Workers Builds runs again."
+ echo "**Manual redeploy / 手动重新部署:** the Fork is already aligned, so this run will push an empty commit and request a fresh Cloudflare build."
fi
echo ""
echo "Prefer this workflow over GitHub **Sync fork**. Mirror mode owns the managed product tree while preserving the Fork's local updater layer and \`.github/workflows/**\`."
} >> "${GITHUB_STEP_SUMMARY}"
+ if [ "${republish_only}" = "true" ]; then
+ echo "::notice title=Manual redeploy / 手动重新部署::Fork code is already v${target_version}. This run will push an empty commit and request a fresh Cloudflare build."
+ elif [ "${update_required}" = "true" ]; then
+ echo "::notice title=EdgeEver update / EdgeEver 更新::Fork main v${head_version} will be synchronized to v${target_version}, then a Cloudflare build will be requested."
+ else
+ echo "::notice title=Scheduled check / 定时检查::Fork code is already v${target_version}. No Git push or Cloudflare deployment was requested by this run."
+ fi
+
echo "channel=${UPDATE_CHANNEL} target=${target_ref}@${target_commit:0:12} (v${target_version}) head=${head_commit:0:12} (v${head_version}) reason=${reason} align=${align_mode} update=${update_required} republish=${republish_only}"
- name: Align to upstream
@@ -295,7 +299,8 @@ jobs:
echo "mode=${ALIGN_MODE}_commit" >> "${GITHUB_OUTPUT}"
echo "Published ${ALIGN_MODE} update for ${TARGET_REF} without changing downstream workflows."
- - name: Trigger Cloudflare Deploy Hook
+ - name: Request Cloudflare deployment
+ id: deploy
if: steps.publish.outcome == 'success'
env:
DEPLOY_HOOK_URL: ${{ secrets.EDGE_EVER_CLOUDFLARE_DEPLOY_HOOK_URL }}
@@ -304,14 +309,16 @@ jobs:
if [ -z "${DEPLOY_HOOK_URL:-}" ]; then
echo "No EDGE_EVER_CLOUDFLARE_DEPLOY_HOOK_URL secret — relying on Cloudflare Git integration for main pushes."
echo "Optional: add a Workers/Pages Deploy Hook secret if pushes do not start builds." >> "${GITHUB_STEP_SUMMARY}"
+ echo "method=git_push" >> "${GITHUB_OUTPUT}"
exit 0
fi
curl -fsS -X POST "${DEPLOY_HOOK_URL}" >/dev/null
echo "Triggered Cloudflare Deploy Hook."
+ echo "method=git_push_and_deploy_hook" >> "${GITHUB_OUTPUT}"
echo "" >> "${GITHUB_STEP_SUMMARY}"
echo "Triggered optional Cloudflare Deploy Hook after publish." >> "${GITHUB_STEP_SUMMARY}"
- - name: Final status
+ - name: Report result / 输出结果
if: always() && steps.upstream.outcome == 'success'
env:
TARGET_REF: ${{ steps.upstream.outputs.target_ref }}
@@ -321,30 +328,76 @@ jobs:
REPUBLISH_ONLY: ${{ steps.upstream.outputs.republish_only }}
REASON: ${{ steps.upstream.outputs.reason }}
ALIGN_MODE: ${{ steps.upstream.outputs.align_mode }}
+ PUBLISH_OUTCOME: ${{ steps.publish.outcome }}
+ PUBLISH_MODE: ${{ steps.publish.outputs.mode }}
+ DEPLOY_TRIGGER_OUTCOME: ${{ steps.deploy.outcome }}
+ DEPLOY_TRIGGER_METHOD: ${{ steps.deploy.outputs.method }}
run: |
set -euo pipefail
final_commit="$(git rev-parse HEAD)"
+ git_result="Not requested / 未请求"
+ deploy_result="Not requested / 未请求"
+ live_result="Not changed by this run / 本次运行未改变线上部署"
+ live_status="unchanged"
+ notice_level="notice"
+ notice_title="Scheduled check / 定时检查"
+ notice_body="Fork code is already v${TARGET_VERSION}. No Git push or Cloudflare deployment was requested."
+
+ if [ "${UPDATE_REQUIRED}" = "true" ] || [ "${REPUBLISH_ONLY}" = "true" ]; then
+ live_result="Not verified by this workflow / 本工作流未验证"
+ live_status="not_verified"
+ if [ "${PUBLISH_OUTCOME}" != "success" ]; then
+ git_result="Failed (\`${PUBLISH_OUTCOME}\`) / 失败"
+ deploy_result="Not requested because Git publish failed / 因 Git 发布失败而未请求"
+ notice_level="error"
+ notice_title="Git publish failed / Git 发布失败"
+ notice_body="The Fork could not publish v${TARGET_VERSION}; no Cloudflare deployment was requested."
+ else
+ case "${PUBLISH_MODE}" in
+ empty_commit)
+ git_result="Redeploy commit pushed / 已推送重部署 commit"
+ ;;
+ *)
+ git_result="Version update pushed (\`${ALIGN_MODE}\`) / 已推送版本更新"
+ ;;
+ esac
+
+ if [ "${DEPLOY_TRIGGER_OUTCOME}" = "success" ]; then
+ case "${DEPLOY_TRIGGER_METHOD}" in
+ git_push_and_deploy_hook)
+ deploy_result="Requested by Git push and Deploy Hook / 已通过 Git push 和 Deploy Hook 请求"
+ ;;
+ *)
+ deploy_result="Requested by Git push / 已通过 Git push 请求"
+ ;;
+ esac
+ notice_title="Deployment requested / 已请求部署"
+ notice_body="Fork main is ${final_commit:0:12} (v${TARGET_VERSION}). Confirm Cloudflare Deployments builds this commit; the live version is not verified here."
+ else
+ deploy_result="Trigger failed (\`${DEPLOY_TRIGGER_OUTCOME}\`) / 触发失败"
+ notice_level="error"
+ notice_title="Deployment trigger failed / 部署触发失败"
+ notice_body="Fork main is ${final_commit:0:12} (v${TARGET_VERSION}), but the Cloudflare deployment request failed."
+ fi
+ fi
+ fi
+
{
echo ""
- echo "### Result"
+ echo "### Result / 结果"
echo ""
- echo "| Field | Value |"
+ echo "| Field / 字段 | Value / 值 |"
echo "| --- | --- |"
- echo "| Final main | \`${final_commit:0:12}\` |"
- echo "| Target | \`${TARGET_REF}\` / v${TARGET_VERSION} |"
- if [ "${UPDATE_REQUIRED}" = "true" ]; then
- echo "| Outcome | Updated and published (\`${ALIGN_MODE}\`) |"
- echo ""
- echo "Cloudflare Workers Builds should deploy this commit from \`main\`. Confirm the Deployment commit SHA matches \`${final_commit:0:12}\`."
- elif [ "${REPUBLISH_ONLY}" = "true" ]; then
- echo "| Outcome | Republished empty commit for redeploy |"
- else
- echo "| Outcome | Already aligned (\`${REASON}\`) — no push |"
- echo ""
- echo "If the live site still shows an older version while Git is current, open Cloudflare **Deployments** and retry the latest build, or re-run this workflow with **force_redeploy**."
- fi
+ echo "| Target version / 目标版本 | \`${TARGET_REF}\` / v${TARGET_VERSION} |"
+ echo "| Final main / 最终 main | \`${final_commit:0:12}\` |"
+ echo "| Git publish / Git 发布 | ${git_result} |"
+ echo "| Deployment trigger / 部署触发 | ${deploy_result} |"
+ echo "| Live deployment / 线上部署 | ${live_result} |"
+ echo ""
+ echo "When a deployment was requested, confirm Cloudflare **Deployments** builds commit \`${final_commit:0:12}\`. / 若已请求部署,请在 Cloudflare **Deployments** 中确认构建 commit 为 \`${final_commit:0:12}\`。"
} >> "${GITHUB_STEP_SUMMARY}"
- echo "final=${final_commit:0:12} reason=${REASON} update=${UPDATE_REQUIRED} republish=${REPUBLISH_ONLY}"
+ echo "::${notice_level} title=${notice_title}::${notice_body}"
+ echo "result target=v${TARGET_VERSION} final=${final_commit:0:12} git_publish=${PUBLISH_OUTCOME} publish_mode=${PUBLISH_MODE:-none} deploy_trigger=${DEPLOY_TRIGGER_OUTCOME} deploy_method=${DEPLOY_TRIGGER_METHOD:-none} live=${live_status}"
- name: Report an update failure
if: failure()
diff --git a/docs/agent-deploy-cloudflare.md b/docs/agent-deploy-cloudflare.md
index 108a4a4a..f2ca1690 100644
--- a/docs/agent-deploy-cloudflare.md
+++ b/docs/agent-deploy-cloudflare.md
@@ -47,7 +47,7 @@ This document defines the standard operating specifications and conventions for
- Verify login API using username `admin` and `EDGE_EVER_AUTH_PASSWORD`. If an advanced deployment sets the `EDGE_EVER_AUTH_USERNAME` Builds variable, use that username instead.
7. **Verify Upstream Update Channel**
- - Manually trigger **Update deployed EdgeEver** once in the Fork's **Actions** tab.
+ - Manually trigger **Update deployed EdgeEver** once in the Fork's **Actions** tab. A manual run republishes the selected version even when the Fork is already aligned, ensuring Cloudflare receives a fresh build event.
- Open the job **Summary** and confirm it reports Fork mode `mirror`, the upstream target (stable Release or edge `main`), and either an update publish or an explicit *already aligned* result.
- Confirm Cloudflare **Deployments** builds the published `main` commit when a push occurred.
- Do not edit deployment files or rely on GitHub **Sync fork** for routine upgrades; the workflow is the only synchronization path needed by a normal deployment Fork. Use **Sync fork** once only when an old Fork must receive a newer updater workflow itself, then return to **Update deployed EdgeEver**.
diff --git a/docs/agent-deploy-cloudflare.zh-CN.md b/docs/agent-deploy-cloudflare.zh-CN.md
index cf5781c2..63b8cc87 100644
--- a/docs/agent-deploy-cloudflare.zh-CN.md
+++ b/docs/agent-deploy-cloudflare.zh-CN.md
@@ -47,7 +47,7 @@
- 使用用户名 `admin` 和 `EDGE_EVER_AUTH_PASSWORD` 验证登录 API;若高级部署设置了 `EDGE_EVER_AUTH_USERNAME` 构建变量,则改用对应用户名。
7. **验证上游更新通道**
- - 在 Fork 的 **Actions** 中手动运行一次 **Update deployed EdgeEver**。
+ - 在 Fork 的 **Actions** 中手动运行一次 **Update deployed EdgeEver**。即使 Fork 已对齐,手动运行也会重新发布所选版本,确保 Cloudflare 收到新的构建事件。
- 打开 Job **Summary**,确认 Fork mode 为 `mirror`,并显示上游目标(stable Release 或 edge `main`),以及「已发布更新」或明确的「已对齐」结果。
- 若发生了 push,确认 Cloudflare **Deployments** 构建的是对应的 `main` commit。
- 普通部署 Fork 不应修改部署文件,日常升级也不要依赖 GitHub **Sync fork**;本工作流就是唯一需要的同步路径。只有旧 Fork 必须取得新版更新工作流本身时,才使用一次 **Sync fork**,之后继续使用 **Update deployed EdgeEver**。
diff --git a/docs/cloudflare-workers-builds.md b/docs/cloudflare-workers-builds.md
index b4b74833..6b4983fd 100644
--- a/docs/cloudflare-workers-builds.md
+++ b/docs/cloudflare-workers-builds.md
@@ -26,10 +26,10 @@ Backward compatibility is automatic: without explicit R2 or username Builds vari
- Only forks that explicitly set `EDGE_EVER_PRESERVE_FORK_CHANGES=true` merge product changes. A customized merge runs local migrations, the complete non-E2E test suite, type checks, and the production build before pushing; any failure leaves `main` and production unchanged.
- Formal Releases run the same complete non-E2E suite on an official Ubuntu job before Draft assets are prepared. This keeps the stable channel's upstream baseline green, so customized-fork failures indicate an integration problem rather than a test already broken by the Release itself.
- The complete downstream `.github/workflows/**` directory and two updater helper scripts form a stable local bootstrap layer. Official packaging, signing, testing, and Release workflows are not part of automatic product updates, so `GITHUB_TOKEN` never needs permission to rewrite Actions workflows.
- - Every run writes a job **Summary** with channel, target version, decision reason, and whether a push happened. A green run that says *Already on upstream target* is success, not a silent failure.
+ - Every run writes a bilingual job **Summary** that separates the Fork's Git state, the deployment trigger, and live-deployment verification. A green scheduled run that says *Already on upstream target* means no deployment was requested; a successful push means deployment was requested but still must be confirmed in Cloudflare.
- Prefer this workflow over GitHub **Sync fork**. Sync fork follows upstream `main` history and can make the next stable run a deliberate no-op.
- Optional: repository secret `EDGE_EVER_CLOUDFLARE_DEPLOY_HOOK_URL` triggers a Cloudflare Deploy Hook after a successful push (useful when the Git integration misses a push).
-- Optional: re-run the workflow with **force_redeploy** to push an empty commit when Git is already current but Cloudflare needs another build.
+- Manually running the workflow redeploys the selected version even when Git is already current: it pushes an empty commit so Cloudflare receives a fresh build event. Scheduled checks remain no-op when already aligned.
- Build failure: inspect the Worker **Deployments** log and confirm the Deployment commit SHA matches Fork `main`.
- Scheduled update never runs: on a public Fork, enable **Update deployed EdgeEver** under **Actions** (scheduled workflows are disabled by default on forks, and may pause after long inactivity).
- Update push is rejected with `without workflows permission`: the Fork still has an older updater. Use GitHub **Sync fork** once with the repository owner's permission, then re-run **Update deployed EdgeEver**. Routine product updates do not require **Sync fork** after that bootstrap.
diff --git a/docs/cloudflare-workers-builds.zh-CN.md b/docs/cloudflare-workers-builds.zh-CN.md
index 4363cfe5..071e5369 100644
--- a/docs/cloudflare-workers-builds.zh-CN.md
+++ b/docs/cloudflare-workers-builds.zh-CN.md
@@ -26,10 +26,10 @@
- 只有显式设置 `EDGE_EVER_PRESERVE_FORK_CHANGES=true` 的 Fork 才会合并产品代码。定制合并会在 push 前执行本地 migration、完整非 E2E 测试、类型检查和生产构建;任一步失败都会保持 `main` 与线上版本不变。
- 正式 Release 会在准备 Draft 资产前,由官方 Ubuntu Job 执行同一套完整非 E2E 测试,确保 stable 通道的上游基线本身为绿色;定制 Fork 若失败,应代表合并集成问题,而不是 Release 自带的测试已经失败。
- 下游完整的 `.github/workflows/**` 目录和两个更新辅助脚本会作为稳定的本地引导层原样保留。官方打包、签名、测试与 Release 工作流不参与产品代码自动更新,因此 `GITHUB_TOKEN` 无需取得改写 Actions 工作流的权限。
- - 每次运行都会写 Job **Summary**:通道、目标版本、判定原因、是否 push。若 Summary 写明 *Already on upstream target* / 已对齐,绿色成功表示「已是目标版本」,不是静默故障。
+ - 每次运行都会写中英双语 Job **Summary**,分别展示 Fork 的 Git 状态、部署触发状态和线上验证状态。若定时运行绿色成功并写明 *Already on upstream target* / 已对齐,表示本次未请求部署;push 成功只表示已请求部署,仍需在 Cloudflare 中确认。
- 请优先用本工作流,而不是 GitHub **Sync fork**。Sync fork 跟的是上游 `main` 历史,可能让下一次 stable 运行合理变为 no-op。
- 可选:仓库 Secret `EDGE_EVER_CLOUDFLARE_DEPLOY_HOOK_URL`,在成功 push 后触发 Cloudflare Deploy Hook(Git 集成偶发未构建时有用)。
-- 可选:Git 已是最新但 Cloudflare 需要再构建时,手动运行工作流并勾选 **force_redeploy**(会推送空 commit)。
+- 手动运行工作流时,即使 Git 已是最新,也会推送空 commit 重新触发 Cloudflare 构建;定时检查在已对齐时仍保持 no-op。
- 构建失败:查看 Worker **Deployments** 日志,确认部署 commit SHA 与 Fork `main` 一致。
- 定时任务从不运行:公共 Fork 需在 **Actions** 中启用 **Update deployed EdgeEver**(Fork 上 schedule 默认禁用,长期不活跃也可能被暂停)。
- 更新 push 被 `without workflows permission` 拒绝:说明 Fork 仍在使用旧版更新器。请用仓库所有者权限执行一次 GitHub **Sync fork**,再重新运行 **Update deployed EdgeEver**;完成这次引导后,日常产品更新不再需要 **Sync fork**。
diff --git a/docs/deploy-cloudflare-button.md b/docs/deploy-cloudflare-button.md
index dc632397..fcd2a2ef 100644
--- a/docs/deploy-cloudflare-button.md
+++ b/docs/deploy-cloudflare-button.md
@@ -120,8 +120,8 @@ Passwords and other credentials remain Worker runtime Secrets and must never be
- **Initial build failed**: Check the Worker **Deployments** log. Verify that the standard resources are named exactly `edgeever` and `edgeever-resources`, and that the Workers Builds API token has D1 read/edit permission. For an intentionally different D1 database, set `EDGE_EVER_D1_DATABASE_NAME`; add `EDGE_EVER_D1_DATABASE_ID` only if automatic UUID discovery is unavailable.
- **Updates not syncing**:
1. On the Fork **Actions** tab, enable **Update deployed EdgeEver** (scheduled workflows are off by default on public forks).
- 2. Run it once with **Run workflow**. Open the job **Summary**: it states the upstream target version and whether the fork was updated, already aligned, or failed.
- 3. A green run with *Already on upstream target* means Git already matches that channel — not a broken skip. If the live site is still old, check Cloudflare **Deployments** commit SHA, or re-run with **force_redeploy**.
+ 2. Run it once with **Run workflow**. Open the bilingual job **Summary**: it separately reports the upstream target, Git publish result, deployment trigger, and whether the live deployment was verified.
+ 3. A scheduled green run with *Already on upstream target* means Git already matches that channel — not a broken skip. A manual run automatically republishes the selected version when already aligned. If the live site is still old afterward, compare the Cloudflare **Deployments** commit SHA.
4. Prefer this workflow over GitHub **Sync fork** for day-to-day upgrades.
5. If an old updater fails with `without workflows permission`, use **Sync fork** once as the repository owner, then re-run **Update deployed EdgeEver**. The current updater preserves `.github/workflows/**`, so later product updates do not hit this permission boundary.
- **Push succeeded but site unchanged**: Confirm Workers Builds ran for the new `main` SHA. Optionally add repository secret `EDGE_EVER_CLOUDFLARE_DEPLOY_HOOK_URL` so the workflow can call a Deploy Hook after publish.
diff --git a/docs/deploy-cloudflare-button.zh-CN.md b/docs/deploy-cloudflare-button.zh-CN.md
index 605e4a59..d8392476 100644
--- a/docs/deploy-cloudflare-button.zh-CN.md
+++ b/docs/deploy-cloudflare-button.zh-CN.md
@@ -120,8 +120,8 @@ EDGE_EVER_UPDATE_CHANNEL=edge
- **首次构建失败**:请检查 Cloudflare 控制台中 Worker 的 **Deployments** 构建日志,确认标准资源名称严格为 `edgeever` 与 `edgeever-resources`,并确认 Workers Builds API Token 具有 D1 读取和编辑权限。如有意使用其他 D1 数据库,请设置 `EDGE_EVER_D1_DATABASE_NAME`;仅在自动查询 UUID 不可用时再添加 `EDGE_EVER_D1_DATABASE_ID`。
- **无法同步上游更新**:
1. 打开 Fork 的 **Actions**,启用 **Update deployed EdgeEver**(公共 Fork 上定时任务默认关闭)。
- 2. 手动 **Run workflow** 一次,打开 Job **Summary**:会写明上游目标版本,以及本次是「已更新」「已对齐」还是失败。
- 3. 若绿色成功且 Summary 为 *Already on upstream target* / 已对齐,表示 Git 已是该通道目标版本,不是静默故障。若网站仍旧,请对照 Cloudflare **Deployments** 的 commit SHA,或勾选 **force_redeploy** 再跑一次。
+ 2. 手动 **Run workflow** 一次,打开中英双语 Job **Summary**:会分别展示上游目标、Git 发布结果、部署触发状态,以及线上部署是否已经验证。
+ 3. 若定时运行绿色成功且 Summary 为 *Already on upstream target* / 已对齐,表示 Git 已是该通道目标版本,不是静默故障。手动运行在已对齐时会自动重新发布所选版本;若此后网站仍旧,请对照 Cloudflare **Deployments** 的 commit SHA。
4. 日常升级请优先用本工作流,而不是 GitHub **Sync fork**。
5. 若旧版更新器报错 `without workflows permission`,请使用仓库所有者身份执行一次 **Sync fork**,然后重新运行 **Update deployed EdgeEver**。新版更新器会保留 `.github/workflows/**`,后续产品更新不会再触发这项权限限制。
- **Git 已 push 但网站没变**:确认 Workers Builds 是否针对新的 `main` SHA 构建。可选:添加仓库 Secret `EDGE_EVER_CLOUDFLARE_DEPLOY_HOOK_URL`,让工作流在 publish 后调用 Deploy Hook。
diff --git a/packages/shared/src/i18n/en-US.ts b/packages/shared/src/i18n/en-US.ts
index 9e8c7351..ec90d6d6 100644
--- a/packages/shared/src/i18n/en-US.ts
+++ b/packages/shared/src/i18n/en-US.ts
@@ -575,7 +575,7 @@ export const enUS = {
unknown: "Unknown",
copy: "Copy info",
updateAvailableTitle: "New version available",
- updateAvailableDescription: "This version is out of date. The latest version is {{version}}.",
+ updateAvailableDescription: "Version {{version}} is available. Review what’s new before updating.",
viewRelease: "View update",
latestVersion: "You are running the latest version",
closeUpdateNotice: "Close update notice",
diff --git a/packages/shared/src/i18n/zh-CN.ts b/packages/shared/src/i18n/zh-CN.ts
index 02d3e9c0..1802b17c 100644
--- a/packages/shared/src/i18n/zh-CN.ts
+++ b/packages/shared/src/i18n/zh-CN.ts
@@ -575,7 +575,7 @@ export const zhCN = {
unknown: "未知",
copy: "复制信息",
updateAvailableTitle: "发现新版本",
- updateAvailableDescription: "当前版本较旧,最新版本为 {{version}}。",
+ updateAvailableDescription: "已有新版本 {{version}},可查看更新内容后升级。",
viewRelease: "查看更新",
latestVersion: "当前已是最新版本",
closeUpdateNotice: "关闭新版本提示",
diff --git a/scripts/upstream-sync-plan.mjs b/scripts/upstream-sync-plan.mjs
index 2c558155..f09d6120 100644
--- a/scripts/upstream-sync-plan.mjs
+++ b/scripts/upstream-sync-plan.mjs
@@ -53,10 +53,21 @@ function readBooleanEnvironment(name) {
throw new Error(`${name} must be either true or false`);
}
+export const shouldRedeploy = ({ eventName, forceRedeploy }) =>
+ forceRedeploy || eventName === "workflow_dispatch";
+
function runCli() {
+ // Older deployment Forks keep their local workflow bootstrap, where manual
+ // runs passed FORCE_REDEPLOY=false unless a checkbox was discovered and set.
+ // GitHub always provides GITHUB_EVENT_NAME, so a planner loaded from a newer
+ // upstream target can give those Forks the corrected manual-run behavior too.
+ const forceRedeploy = shouldRedeploy({
+ eventName: process.env.GITHUB_EVENT_NAME,
+ forceRedeploy: readBooleanEnvironment("EDGE_SYNC_FORCE_REDEPLOY"),
+ });
const plan = decideUpstreamSync({
contentMatchesTarget: readBooleanEnvironment("EDGE_SYNC_CONTENT_MATCHES_TARGET"),
- forceRedeploy: readBooleanEnvironment("EDGE_SYNC_FORCE_REDEPLOY"),
+ forceRedeploy,
headEqualsTarget: readBooleanEnvironment("EDGE_SYNC_HEAD_EQUALS_TARGET"),
headIsAncestorOfTarget: readBooleanEnvironment("EDGE_SYNC_HEAD_IS_ANCESTOR_OF_TARGET"),
preserveForkChanges: readBooleanEnvironment("EDGE_SYNC_PRESERVE_FORK_CHANGES"),
diff --git a/tests/deployment-entrypoints.test.ts b/tests/deployment-entrypoints.test.ts
index 1fc6f584..be458e93 100644
--- a/tests/deployment-entrypoints.test.ts
+++ b/tests/deployment-entrypoints.test.ts
@@ -14,7 +14,10 @@ import {
deploymentPrompts,
manualDeploymentCopy,
} from "../apps/site/src/deployment-prompts";
-import { decideUpstreamSync } from "../scripts/upstream-sync-plan.mjs";
+import {
+ decideUpstreamSync,
+ shouldRedeploy,
+} from "../scripts/upstream-sync-plan.mjs";
import { repositoryWranglerConfigError } from "../scripts/wrangler-runner.mjs";
const repositoryRoot = resolve(import.meta.dir, "..");
@@ -374,7 +377,8 @@ describe("Cloudflare deployment entrypoints", () => {
expect(workflow).toContain("EDGE_EVER_UPDATE_CHANNEL");
expect(workflow).toContain("stable)");
expect(workflow).toContain("edge)");
- expect(workflow).toContain("force_redeploy");
+ expect(workflow).toContain("FORCE_REDEPLOY: ${{ github.event_name == 'workflow_dispatch' }}");
+ expect(workflow).not.toContain("force_redeploy:");
expect(workflow).toContain("bun run db:migrate:local");
expect(bunConfig).toContain('pathIgnorePatterns = ["tests/e2e/**"]');
expect(scripts.test).toBe("bun test --path-ignore-patterns='tests/e2e/**'");
@@ -392,6 +396,15 @@ describe("Cloudflare deployment entrypoints", () => {
expect(workflow).toContain("already_on_target");
expect(workflow).toContain("fork_mode=mirror");
expect(workflow).toContain("GITHUB_STEP_SUMMARY");
+ expect(workflow).toContain("name: Sync Fork and trigger deployment");
+ expect(workflow).toContain("name: Report result / 输出结果");
+ expect(workflow).toContain("::notice title=Manual redeploy / 手动重新部署");
+ expect(workflow).toContain("PUBLISH_OUTCOME: ${{ steps.publish.outcome }}");
+ expect(workflow).toContain("DEPLOY_TRIGGER_OUTCOME: ${{ steps.deploy.outcome }}");
+ expect(workflow).toContain("| Git publish / Git 发布 |");
+ expect(workflow).toContain("| Deployment trigger / 部署触发 |");
+ expect(workflow).toContain("| Live deployment / 线上部署 |");
+ expect(workflow).toContain("Not verified by this workflow / 本工作流未验证");
expect(workflow).toContain("EDGE_EVER_CLOUDFLARE_DEPLOY_HOOK_URL");
expect(workflow).toContain("EDGE_EVER_PRESERVE_FORK_CHANGES");
expect(workflow).toContain("PRESERVE_FORK_CHANGES");
@@ -421,24 +434,35 @@ describe("Cloudflare deployment entrypoints", () => {
}
});
- test("keeps a forced-redeploy commit on the deploy-mirror update path", () => {
+ test("republishes an already-aligned deploy mirror when redeploy is requested", () => {
expect(
decideUpstreamSync({
- contentMatchesTarget: false,
- forceRedeploy: false,
- headEqualsTarget: false,
- headIsAncestorOfTarget: false,
+ contentMatchesTarget: true,
+ forceRedeploy: true,
+ headEqualsTarget: true,
+ headIsAncestorOfTarget: true,
preserveForkChanges: false,
- targetIsAncestorOfHead: false,
+ targetIsAncestorOfHead: true,
}),
).toEqual({
- alignMode: "snapshot",
- reason: "deploy_mirror_reset",
- republishOnly: false,
- updateRequired: true,
+ alignMode: "none",
+ reason: "already_on_target",
+ republishOnly: true,
+ updateRequired: false,
});
});
+ test("manual dispatch redeploys through an older Fork workflow", () => {
+ expect(shouldRedeploy({
+ eventName: "workflow_dispatch",
+ forceRedeploy: false,
+ })).toBe(true);
+ expect(shouldRedeploy({
+ eventName: "schedule",
+ forceRedeploy: false,
+ })).toBe(false);
+ });
+
test("snapshots a deploy mirror that moved ahead of the stable release", () => {
expect(
decideUpstreamSync({