Get Parent Folder is a free Automator action which will return the parent folder of the input files and folders.