I already had a look at this question, but I wonder how I can securely download a single from a private Git repository in a declarative pipeline, preferably using a credentials ID or similar.
I assume I have to use something like:
sh 'git archive ... || tar --extract'