mirror of
https://github.com/renovatebot/github-action.git
synced 2025-12-17 01:12:35 +00:00
chore: cleanup
This commit is contained in:
parent
7fefe10768
commit
9bbd18ebe1
1 changed files with 13 additions and 5 deletions
|
|
@ -20,11 +20,7 @@ class Renovate {
|
||||||
}
|
}
|
||||||
|
|
||||||
async runDockerContainer(): Promise<void> {
|
async runDockerContainer(): Promise<void> {
|
||||||
const groups = await fs.promises.readFile('/etc/group', {
|
const group = await this.getDockerGroup();
|
||||||
encoding: 'utf-8',
|
|
||||||
});
|
|
||||||
const [, group] = /^docker:x:([1-9][0-9]*):$/m.exec(groups);
|
|
||||||
// await exec('sudo', ['chmod', 'o=rw', '/var/run/docker.sock']);
|
|
||||||
const commandArguments = [
|
const commandArguments = [
|
||||||
'--rm',
|
'--rm',
|
||||||
`--env ${this.configFileEnv}=${this.configFileMountPath()}`,
|
`--env ${this.configFileEnv}=${this.configFileMountPath()}`,
|
||||||
|
|
@ -43,6 +39,18 @@ class Renovate {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fetch the host docker group on github.
|
||||||
|
* Container user needs this to access the docker socket.
|
||||||
|
*/
|
||||||
|
private async getDockerGroup(): Promise<string> {
|
||||||
|
const groups = await fs.promises.readFile('/etc/group', {
|
||||||
|
encoding: 'utf-8',
|
||||||
|
});
|
||||||
|
const [, group] = /^docker:x:([1-9][0-9]*):$/m.exec(groups);
|
||||||
|
return group;
|
||||||
|
}
|
||||||
|
|
||||||
private validateArguments(): void {
|
private validateArguments(): void {
|
||||||
if (!fs.existsSync(this.configFile)) {
|
if (!fs.existsSync(this.configFile)) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue