1717# 3rd party imports go here
1818import requests
1919from github import Github , GithubException
20- from west .manifest import Manifest , MalformedManifest , ImportFlag
20+ from west .manifest import Manifest , MalformedManifest , ImportFlag , \
21+ MANIFEST_PROJECT_INDEX
2122
2223NOTE = "\n \n *Note: This message is automatically posted and updated by the " \
2324 "Manifest GitHub Action.* "
@@ -414,13 +415,20 @@ def main():
414415 (old_manifest , new_manifest ) = _get_manifests_from_gh (token , gh_repo ,
415416 mpath , new_mfile ,
416417 base_sha )
418+ # Ensure we only remove the manifest project
419+ assert (MANIFEST_PROJECT_INDEX == 0 )
420+ omp = old_manifest .projects [MANIFEST_PROJECT_INDEX ]
421+ nmp = new_manifest .projects [MANIFEST_PROJECT_INDEX ]
422+ ops = old_manifest .projects [MANIFEST_PROJECT_INDEX + 1 :]
423+ nps = new_manifest .projects [MANIFEST_PROJECT_INDEX + 1 :]
417424
418- old_projs = set ((p .name , p .revision ) for p in old_manifest . projects )
419- new_projs = set ((p .name , p .revision ) for p in new_manifest . projects )
425+ old_projs = set ((p .name , p .revision ) for p in ops )
426+ new_projs = set ((p .name , p .revision ) for p in nps )
420427
421428 log (f'old_projs: { old_projs } ' )
422429 log (f'new_projs: { new_projs } ' )
423430
431+ log ('Revision sets' )
424432 (projs , rprojs , uprojs , aprojs ) = _get_sets (old_projs , new_projs )
425433
426434 projs_names = [name for name , rev in projs ]
@@ -441,7 +449,7 @@ def main():
441449 strs = list ()
442450 if message :
443451 strs .append (message )
444- strs .append ('The following west manifest projects have been modified in this Pull '
452+ strs .append ('The following west manifest projects have changed revision in this Pull '
445453 'Request:\n ' )
446454 strs .append ('| Name | Old Revision | New Revision | Diff |' )
447455 strs .append ('| ---- | ------------ | ------------ |------|' )
0 commit comments