feat(volume-mount): mount docker volumes as input (#797)

Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
This commit is contained in:
r-binder 2023-12-05 18:03:15 +01:00 committed by GitHub
parent 6bd5cd83c4
commit fcce0a0ee8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 44 additions and 1 deletions

View file

@ -82,6 +82,14 @@ class Input {
return core.getInput('docker-user') || null;
}
getDockerVolumeMounts(): string[] {
return core
.getInput('docker-volumes')
.split(';')
.map((v) => v.trim())
.filter((v) => !!v);
}
/**
* Convert to environment variables.
*

View file

@ -53,7 +53,11 @@ class Renovate {
dockerArguments.push(`--user ${dockerUser}`);
}
dockerArguments.push('--volume /tmp:/tmp', '--rm', this.docker.image());
for (const volumeMount of this.input.getDockerVolumeMounts()) {
dockerArguments.push(`--volume ${volumeMount}`);
}
dockerArguments.push('--rm', this.docker.image());
if (dockerCmd !== null) {
dockerArguments.push(dockerCmd);