Skip to content

Commit d42d5c2

Browse files
carlescufirlubos
authored andcommitted
scripts: ncs_commands: Exit in certain conditions
The https://github.com/nrfconnect/action-oss-history action uses "west ncs-loot" to check the history of OSS repos. The action needs to fail whenever something is amiss in the run, so bump the severity of certain (non-recoverable) errors and a warning in order to ensure we never ignore errors in the action. Signed-off-by: Carles Cufi <[email protected]>
1 parent ee06d2b commit d42d5c2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

scripts/west_commands/ncs_commands.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,13 +234,13 @@ def to_ncs_repository(self, project: Project) -> Optional[nwh.Repository]:
234234
if ncs_sha is None:
235235
if not self.manifest.is_active(project):
236236
help_url = 'https://docs.zephyrproject.org/latest/develop/west/manifest.html#project-groups-and-active-projects'
237-
log.err(f"{project.name_and_path}: can't get loot: "
237+
log.die(f"{project.name_and_path}: can't get loot: "
238238
"project is not cloned and is not active. "
239239
'To get loot, first enable these groups: '
240240
f"{' '.join(project.groups)} (see {help_url}). "
241241
'Then, run "west update".')
242242
else:
243-
log.err(f"{project.name_and_path}: can't get loot: "
243+
log.die(f"{project.name_and_path}: can't get loot: "
244244
'project is not cloned; please run "west update"')
245245
return None
246246
return to_repository(project, ncs_sha)
@@ -265,7 +265,7 @@ def to_upstream_repository(self, project: Project) -> Optional[nwh.Repository]:
265265

266266
upstream_sha = self.checked_sha(project, upstream_rev)
267267
if upstream_sha is None:
268-
log.wrn(f"{project.name_and_path}: can't get loot: "
268+
log.die(f"{project.name_and_path}: can't get loot: "
269269
"please fetch upstream URL "
270270
f'{upstream_url} (need revision {upstream_rev})')
271271
return None

0 commit comments

Comments
 (0)