Remove Orphaned Actions from Drupal 6 & 7

I first noticed this issue when using Drush to enable a module. Drupal core will present a warning displaying something along the lines of:

orphaned actions (comment_publish) exist in the actions table. Remove orphaned actions

The answer wasn't readily Googled, but after some quick digging I found 2 solutions.

Method 1

Login as user 1 aka 'admin' and visit: http://yourwebsite.com/admin/settings/actions/orphan.

Method 2

This method can be done anywhere you can execute PHP. This same code is run when you access the page in method 1. I have provided the code in a format which you can paste to Drush, but feel free to pull out the function and use it manually.

drush php-eval "actions_synchronize(actions_list(), TRUE);"