So I've switched to Xcode 14, and it gave me a lot of compile errors, most of them were related to signing the internal frameworks (the app is well-modularized). While I've been doing that manually (updating about 70 modules), I felt bad as it's a waste of time, and the problem can happen again in the future.
I've found this thread where CODE_SIGN_STYLE=Manual is mentioned, but grep CODE_SIGN_STYLE -r . in a project folder gave me a lot CODE_SIGN_STYLE = Automatic; hits. Also, the checkbox Automatically manage signing is enabled for all of those modules.

I guess it's Xcode14 bug, so all I wanted to ask:
- How have you solved this problem in case you've met it?
- Could I use some non-custom script like
xcodesign-fix-team-for-automatic-signing --team MY_TEAM_IDto do it in 1 click?
UPD: I've found such strings in project.pbxproj files those "broken" modules:
"CODE_SIGN_IDENTITY[sdk=appletvos*]" = "";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
"CODE_SIGN_IDENTITY[sdk=watchos*]" = "";
But after I manually update the Team in Signing tab, that CODE_SIGN_IDENTITY[sdk=iphoneos*] value is still empty.