Skip to content

Commit 8e9c8ba

Browse files
committed
ci(stm32variant): ensure to use correct default branch
Signed-off-by: Frederic Pillon <[email protected]>
1 parent f0b387a commit 8e9c8ba

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

CI/update/stm32variant.py

+14-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
from pathlib import Path
1313
from xml.dom.minidom import parse, Node
1414

15+
script_path = Path(__file__).parent.resolve()
16+
sys.path.append(str(script_path.parent))
17+
from utils import execute_cmd, getRepoBranchName
18+
1519
mcu_list = [] # 'name'
1620
io_list = [] # 'PIN','name'
1721
alt_list = [] # 'PIN','name'
@@ -2146,11 +2150,20 @@ def manage_repo():
21462150
if not args.skip:
21472151
print(f"Updating {repo_name}...")
21482152
if repo_path.is_dir():
2153+
rname, bname = getRepoBranchName(repo_path)
2154+
21492155
# Get new tags from the remote
21502156
git_cmds = [
21512157
["git", "-C", repo_path, "clean", "-fdx"],
21522158
["git", "-C", repo_path, "fetch"],
2153-
["git", "-C", repo_path, "reset", "--hard", "origin/main"],
2159+
[
2160+
"git",
2161+
"-C",
2162+
repo_path,
2163+
"reset",
2164+
"--hard",
2165+
f"{rname}/{bname}",
2166+
],
21542167
]
21552168
else:
21562169
# Clone it as it does not exists yet

0 commit comments

Comments
 (0)