Skip to content

Commit 6acc503

Browse files
committed
fix issues pointed by the ai reviewer
1 parent f0bba86 commit 6acc503

2 files changed

Lines changed: 12 additions & 3 deletions

File tree

.github/workflows/main.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ jobs:
155155

156156
- name: Semantic Release PR Title Check
157157
uses: osl-incubator/semantic-release-pr-title-check@v1.4.1
158-
if: success() || failure()
158+
if: ${{ always() }}
159159
with:
160160
convention-name: conventionalcommits
161161

src/makim/core.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -913,13 +913,19 @@ def _execute_hook(
913913

914914
try:
915915
return bool(makim_hook.run(deepcopy(args_hook)))
916-
except Exception:
916+
except Exception as e:
917917
hook_task_copy = deepcopy(makim_hook)
918918
hook_task_copy._change_task(hook_task_name)
919919
hook_ignore_errors = hook_task_copy.task_data.get(
920920
'options', {}
921921
).get('ignore-errors', False)
922922

923+
# Log exception for debugging even if ignore-errors is True
924+
if self.verbose or not hook_ignore_errors:
925+
MakimLogs.print_warning(
926+
f'Hook task "{hook_task_name}" failed with exception: {e}'
927+
)
928+
923929
if not hook_ignore_errors:
924930
return False
925931
return True
@@ -1191,12 +1197,15 @@ def run(self, args: dict[str, Any]) -> bool:
11911197
ignore_errors = self.task_data.get('options', {}).get(
11921198
'ignore-errors', False
11931199
)
1200+
failure_hook = bool(self.task_data.get('hooks', {}).get('failure'))
11941201

11951202
pre_run_success = self._run_hooks(args, 'pre-run')
11961203
if not pre_run_success and not ignore_errors:
1204+
# Trigger failure hook if pre-run hooks failed
1205+
if failure_hook:
1206+
self._run_hooks(args, 'failure')
11971207
return False
11981208

1199-
failure_hook = bool(self.task_data.get('hooks', {}).get('failure'))
12001209
retry = bool(self.task_data.get('retry'))
12011210

12021211
success = True

0 commit comments

Comments
 (0)