Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Allow using non-slim renovate image #626

Merged
merged 7 commits into from
Jan 23, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
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';
avorima marked this conversation as resolved.
Show resolved Hide resolved

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 {
viceice marked this conversation as resolved.
Show resolved Hide resolved
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