Power menu (Shutdown, Reboot, Sleep) in ELISP I've written an interactive function which lets me shudown, reboot my machine as well as put it to sleep.

I'm using emacs and I'm just starting out getting into ELISP programming. As I'm a total beginner, I'd like to know what you would do differently in the following code to make it better, lighter and so on. Many thanks in advance.

(defun db/power-menu ()
  "Interactive menu for shutdown, reboot or sleep."
  (interactive)
  (let ((actions '("Shutdown" "Reboot" "Sleep")))
    (setq action (ivy-completing-read "What do you want to do?" actions ))
    (if (y-or-n-p (concat "Execute " action "? Unsaved progress will be lost. "))
        (let ((default-directory "/sudo::"))
          (cond ((equal action "Shutdown")
                 (shell-command "systemctl poweroff"))
                ((equal action "Reboot")
                 (shell-command "systemctl reboot"))
                ((equal action "Sleep")
                 (shell-command "systemctl suspend")))))))
Disclaimer: Total beginner here too. So take everything with a grain of salt.
That being said this looks perfectly fine. However, I suggest you to use completing-read instead of ivy-completing-read as it will provide more flexibility. Don't worry, if you use ivy-mode (or customize completing-read-function to ivy-completing-read), then completing-read will use ivy-completing-read.This is especially helpful if you want to copy your snippet to another Emacs configuration where ivy isn't installed.
Other than that, I guess you want to introduce action before you setq it. However, I'm not really sure whether it's necessary.
Note that I will probably use your db/power-menu in my configuration. Well done :)