Skip to content

Commit

Permalink
Allow using non-slim renovate image
Browse files Browse the repository at this point in the history
Signed-off-by: Mario Valderrama <mario.valderrama@ionos.com>
  • Loading branch information
avorima committed Jan 4, 2023
1 parent dfabf3e commit 00169c6
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
5 changes: 5 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ inputs:
configured using a Secret. Either use this input or the 'RENOVATE_TOKEN'
environment variable.
required: false
useSlim:
description: |
Use a lightweight renovate container without any third-party binaries.
Defaults to true if not set.
required: false
runs:
using: node16
main: dist/index.js
9 changes: 8 additions & 1 deletion src/docker.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
import { Input } from './input';

class Docker {
readonly repository = 'renovate/renovate';
// renovate: datasource=docker depName=renovate/renovate versioning=docker
readonly tag = '34.82.0-slim';
readonly tagSuffix = '-slim';
readonly fullTag: string;

constructor(private input: Input) {
this.fullTag = input.useSlim() ? this.tag : this.version();
}

image(): string {
return `${this.repository}:${this.tag}`;
return `${this.repository}:${this.fullTag}`;
}

version(): string {
Expand Down
4 changes: 4 additions & 0 deletions src/input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ class Input {
return null;
}

useSlim(): boolean {
return core.getInput(`useSlim`) !== 'false';
}

/**
* Convert to environment variables.
*
Expand Down
2 changes: 1 addition & 1 deletion src/renovate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Renovate {
constructor(private input: Input) {
this.validateArguments();

this.docker = new Docker();
this.docker = new Docker(input);
}

async runDockerContainer(): Promise<void> {
Expand Down

0 comments on commit 00169c6

Please sign in to comment.