fetch-inputs: implement proper gpg checking and partial script cleanup