@@ -150,7 +150,7 @@ def check_app_id_matches_flatpak(context, flatpak_path, channel):
150150 flatpak_refs = [ref .split ("/" )[1 ] for ref in flatpak_refs if ref .startswith ("app/" )]
151151
152152 # Create a list, if any, of all unexpected Flatpak IDs present in repo
153- invalid_refs = set (flatpak_refs ) - { context .config ["app_ids" ]}
153+ invalid_refs = set (flatpak_refs ) - set ( context .config ["app_ids" ]. values ())
154154
155155 if context .config ["app_ids" ][channel ] not in flatpak_refs :
156156 raise TaskVerificationError (f"Supplied app ID ({ context .config ['app_ids' ][channel ]} ) is not present in Flatpak!" )
@@ -159,6 +159,15 @@ def check_app_id_matches_flatpak(context, flatpak_path, channel):
159159 raise TaskVerificationError ("One or more invalid app IDs are present in Flatpak!" )
160160
161161
162+ def check_config_for_channel (config , channel ):
163+ """Verify AppID and token location defined for supplied channel"""
164+ if channel not in config ["app_ids" ]:
165+ raise TaskVerificationError (f"Supplied channel ({ channel } ) does not have a configured appID" )
166+
167+ if channel not in config ["token_locations" ]:
168+ raise TaskVerificationError (f"Supplied channel ({ channel } ) does not have a configured token" )
169+
170+
162171def sanitize_buildid (bytes_input ):
163172 """Flathub API returns bytes to we're decoding that to unicode string"""
164173 return bytes_input .decode ().strip ()
@@ -174,6 +183,8 @@ def push(context, flatpak_file_path, channel):
174183 # We don't raise an error because we still want green tasks on dev instances
175184 return
176185
186+ check_config_for_channel (context .config , channel )
187+
177188 token_args = ["--token-file" , context .config ["token_locations" ][channel ]]
178189 log .info ("Grab a flatpak buildid from Flathub ..." )
179190 publish_build_output = run_flat_manager_client_process (
0 commit comments