We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 70e681f commit ebd7332Copy full SHA for ebd7332
update-notes.sh
@@ -42,6 +42,26 @@ fi
42
43
echo "✅ PDF 已输出到: $OUT_FILE"
44
45
+# === 避免 10 分钟内重复 push ===
46
+TIMESTAMP_FILE=".last_push_time"
47
+
48
+if [ -f "$TIMESTAMP_FILE" ]; then
49
+ LAST_PUSH=$(cat "$TIMESTAMP_FILE")
50
+else
51
+ LAST_PUSH=0
52
+fi
53
54
+NOW=$(date +%s)
55
+DIFF=$(( NOW - LAST_PUSH ))
56
57
+if [ $DIFF -lt 600 ]; then
58
+ echo "⏳ 上次 push 距离现在仅 $DIFF 秒 (<600 秒),跳过 push。"
59
+ git add "$TYP_FILE" "$OUT_FILE"
60
+ git commit -m "$COMMIT_MSG" >/dev/null 2>&1
61
+ exit 0
62
63
64
65
# === Git 操作 ===
66
echo "📦 执行 git add/commit/push"
67
@@ -55,7 +75,7 @@ fi
75
76
git push
77
if [ $? -eq 0 ]; then
78
+ echo "$NOW" > "$TIMESTAMP_FILE"
79
echo "✅ Push 完成!GitHub Pages 将自动部署。"
80
else
81
echo "❌ Push 失败,请检查网络或权限。"
-fi
0 commit comments