Skip to content

Commit

Permalink
autoupdater: add a timestamp to the 'ci-auto-update-sources' branch n…
Browse files Browse the repository at this point in the history
…ame (#2282)
  • Loading branch information
OniriCorpe authored May 1, 2024
1 parent b657481 commit fd77292
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions tools/autoupdate_app_sources/autoupdate_app_sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import textwrap
from pathlib import Path
from functools import cache
from datetime import datetime
from datetime import datetime, time

import requests
import toml
Expand Down Expand Up @@ -54,11 +54,13 @@


@cache
def get_github() -> tuple[
Optional[tuple[str, str]],
Optional[github.Github],
Optional[github.InputGitAuthor],
]:
def get_github() -> (
tuple[
Optional[tuple[str, str]],
Optional[github.Github],
Optional[github.InputGitAuthor],
]
):
try:
github_login = (
(REPO_APPS_ROOT / ".github_login")
Expand Down Expand Up @@ -227,7 +229,8 @@ def run(

# Default message
pr_title = commit_msg = "Upgrade sources"
branch_name = "ci-auto-update-sources"
date = datetime.now().strftime("%y%m%d")
branch_name = f"ci-auto-update-sources-{date}"

for source, infos in self.sources.items():
update = self.get_source_update(source, infos)
Expand Down Expand Up @@ -452,8 +455,8 @@ def get_latest_version_and_asset(

api: Union[GithubAPI, GitlabAPI, GiteaForgejoAPI]
if remote_type == "github":
assert upstream and upstream.startswith(
"https://github.com/"
assert (
upstream and upstream.startswith("https://github.com/")
), f"When using strategy {strategy}, having a defined upstream code repo on github.com is required"
api = GithubAPI(upstream, auth=get_github()[0])
if remote_type == "gitlab":
Expand Down

0 comments on commit fd77292

Please sign in to comment.