chore: make worker deploy default to short commit version

- update Deploy to Cloudflare workflow so Worker Lite defaults to the current deployment commit short sha when app_version is not provided

- keep manual app_version override support for explicit releases

- update README and DEPLOYMENT docs to match the new version fallback rule
This commit is contained in:
SmileQWQ
2026-04-22 01:55:03 +08:00
parent 6b45518593
commit db1d4a755b
3 changed files with 5 additions and 6 deletions

View File

@@ -52,12 +52,7 @@ jobs:
exit 0
fi
TAG_VALUE="$(git describe --tags --abbrev=0 2>/dev/null || true)"
if [ -n "$TAG_VALUE" ]; then
echo "value=$TAG_VALUE" >> "$GITHUB_OUTPUT"
else
echo "value=${GITHUB_SHA::7}" >> "$GITHUB_OUTPUT"
fi
echo "value=${GITHUB_SHA::7}" >> "$GITHUB_OUTPUT"
- name: Resolve deploy options
id: deploy_options

View File

@@ -71,6 +71,8 @@ npm run deploy:worker
默认域名前缀是 `subtracker`
如果 `app_version` 留空workflow 会自动使用当前部署 commit 的短 hash 作为版本号。
## 5. 后续更新
后续使用 GitHub 的 **Sync fork** 同步上游代码后,会自动触发部署 workflow。

View File

@@ -93,6 +93,8 @@ npm test
4. 选择 **Deploy to Cloudflare**
5. 点击 **Run workflow**
如果不填写 `app_version`,系统会自动使用当前部署 commit 的短 hash 作为版本号。
### 后续更新
后续直接使用 GitHub 的 **Sync fork** 同步上游代码。