Set a trigger in the macro header (e.g. a hotkey).
In the first (green) action, set the folder path where your files are located. (You can drag the folder from the Finder into the text field of the action.)
If all file names are structured like your two examples, then this should work.
If there are files with identical names before the hyphen, then the first one is renamed and the other ones are left untouched. The notification tells you about any duplicates.
Unless you have thousands of files, this should be reasonably fast.
As always with potentially destructive actions (Move/Rename), first try the macro on a test folder, and make sure the folder path is correct!
All files in a folder, files should remain in place.
I had to download about 300 files. I moved the downloaded files to a new folder. I need the files in that folder renamed to remove everything after the "-" and left in the folder.