The docs say:
The Linux and macOS virtual machines both run using passwordless
sudo. When you need to execute commands or install tools that require more privileges than the current user, you can usesudowithout needing to provide a password.
So simply doing the following should work:
- name: Install xmllint
run: sudo apt-get install -y libxml2-utils