Added support for project-name

Signed-off-by: Václav Valíček <valicek1994@gmail.com>
This commit is contained in:
2022-08-04 16:52:43 +02:00
parent 0e1d535ba0
commit de67130fd5
6 changed files with 56 additions and 10 deletions

View File

@@ -20,10 +20,11 @@ class DetectedCommit:
_log: str = ""
_dict = {}
def __init__(self, env: dict):
def __init__(self, env: dict, project_name: str):
for key in env.keys():
self.__setattr__(f"_{key}", env[key])
self._dict = env
self.project = project_name
@property
def commit(self) -> str:
@@ -232,7 +233,7 @@ class Detector:
'branches': special_branch,
'log': commit.message,
}
env = DetectedCommit(env)
env = DetectedCommit(env, self._project)
log.info(f"Executing CI: commit {self._project}: {env.commit} @ {env.date} by {env.author}")
if env.is_tag or env.is_branch:
log.info(f"Additional info: branch: {env.branches}; tag(s) {env.tags}")