mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-27 23:47:39 +01:00
ci: added back the nightly schedule checking for new commits and only then build
This commit is contained in:
@@ -57,6 +57,21 @@ def getenv(name, default=""):
|
||||
def short_commit():
|
||||
return runAndGet("git rev-parse --short HEAD")
|
||||
|
||||
def count_new_commits(last_commit):
|
||||
if not last_commit or not last_commit.strip():
|
||||
return 0
|
||||
|
||||
try:
|
||||
total = int(runAndGet("git rev-list --count HEAD"))
|
||||
if total == 1:
|
||||
head = runAndGet("git rev-parse HEAD")
|
||||
return 1 if head != last_commit else 0
|
||||
|
||||
out = runAndGet(f"git rev-list --count {last_commit}..HEAD")
|
||||
return int(out)
|
||||
except Exception:
|
||||
return 0
|
||||
|
||||
# ----------------------------------------------------------
|
||||
# BUILD NUMBER RESERVATION
|
||||
# ----------------------------------------------------------
|
||||
@@ -464,6 +479,7 @@ COMMANDS = {
|
||||
# SHARED
|
||||
# ----------------------------------------------------------
|
||||
"commit-id" : (short_commit, 0, ""),
|
||||
"count-new-commits" : (count_new_commits, 1, "<last_successful_commit>"),
|
||||
|
||||
# ----------------------------------------------------------
|
||||
# PROJECT INFO
|
||||
|
||||
Reference in New Issue
Block a user