Skip to content

Commit

Permalink
Strip credentials from url
Browse files Browse the repository at this point in the history
  • Loading branch information
ggoyon committed Sep 10, 2024
1 parent 7e9a8e7 commit 32b5e9c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions scripts/CreateVersionConfFile.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from os.path import(join, isdir, exists)
from datetime import datetime
import subprocess
import re

git_commits_info_file_path = f"./platform/sostrades-webapi/sos_trades_api/git_commits_info.json"
gitignore_file_path = f"./platform/sostrades-webapi/.gitignore"
Expand Down Expand Up @@ -86,7 +87,10 @@ def convert_version(version:str)->list[int]:
print(f"error while converting last commit date {last_commit_date} into datetime")

# get repo url
INFO_REGEXP = ':\/\/.*@'
INFO_REPLACE = '://'
last_commit_url = run_git_command(['git', 'remote', 'get-url', 'origin'])
last_commit_url = re.sub(INFO_REGEXP, INFO_REPLACE, last_commit_url)

# Post-process url to remove .git
if last_commit_url.endswith(".git"):
Expand Down

0 comments on commit 32b5e9c

Please sign in to comment.