I wan to check from groovy pipeline if a specific file (artifact) was collected or not.
How can I access the list of artefacts?
archiveArtifacts artifacts: 'foo.txt', allowEmptyArchive: true
...
// much later
// check if 'foo.txt' was collected?
Please note that I am looking for a solution that does not imply modification of the code that collects the artifacts. This is because this code is in multiple places, I only need something to do at the end, not at any possible call of archiveArtifacts (which can be deeply hidden).