Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ GitHub Action to run Renovate self-hosted.
- [`docker-cmd-file`](#docker-cmd-file)
- [`docker-network`](#docker-network)
- [`docker-socket-host-path`](#docker-socket-host-path)
- [`docker-tty`](#docker-tty)
- [`docker-user`](#docker-user)
- [`docker-volumes`](#docker-volumes)
- [`env-regex`](#env-regex)
Expand Down Expand Up @@ -120,6 +121,11 @@ Allows the overriding of the host path for the Docker socket that is mounted int
Useful on systems where the host Docker socket is located somewhere other than `/var/run/docker.sock` (the default).
Only applicable when `mount-docker-socket` is true.

### `docker-tty`

Defaults to `true`. When enabled, Docker commands are run with `-t` (allocate pseudo-TTY).
Set to `false` to disable TTY allocation.

### `docker-user`

Specify a user (or user-id) to run docker command.
Expand Down
6 changes: 6 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ inputs:
Docker volume mounts. Default to /tmp:/tmp
default: /tmp:/tmp
required: false
docker-tty:
description: |
Allocate a pseudo-TTY (`-t`) for Docker runs.
Set to `false` to disable TTY allocation.
default: 'true'
required: false

runs:
using: node24
Expand Down
4 changes: 4 additions & 0 deletions src/input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ export class Input {
return getInput('docker-network');
}

dockerTty(): boolean {
return getInput('docker-tty') !== 'false';
}

/**
* Convert to environment variables.
*
Expand Down
6 changes: 4 additions & 2 deletions src/renovate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ export class Renovate {
}

async runDockerContainerForVersion(): Promise<string> {
const command = `docker run -t --rm ${this.docker.image()} --version`;
const ttyArgument = this.input.dockerTty() ? '-t ' : '';
const command = `docker run ${ttyArgument}--rm ${this.docker.image()} --version`;

const { exitCode, stdout } = await getExecOutput(command);
if (exitCode !== 0) {
Expand Down Expand Up @@ -87,7 +88,8 @@ export class Renovate {
dockerArguments.push(dockerCmd);
}

const command = `docker run -t ${dockerArguments.join(' ')}`;
const ttyArgument = this.input.dockerTty() ? '-t ' : '';
const command = `docker run ${ttyArgument}${dockerArguments.join(' ')}`;

const code = await exec(command);
if (code !== 0) {
Expand Down
Loading