During a recent pull-request review, I noticed that we had unused dependencies in our mix.lock file due to adding and removing dependencies that were no longer being used. I wondered if there was a quick way to detect this type of issue in Github actions, and there is!

Mix has a handy task that you can run to check for unused dependencies:

mix deps.unlock --check-unused

Within a Github action, you can use the following command to fail CI if there are any unused dependencies in the lock file:

- name: Check mix.lock for unused dependencies
  run: mix deps.unlock --check-unused