mirror of
https://github.com/renovatebot/github-action.git
synced 2025-12-17 01:12:35 +00:00
fix(refactor): use named imports (#879)
Allows better tree shaking while bundling.
This commit is contained in:
parent
5343762d53
commit
4d91b7f286
7 changed files with 77 additions and 36 deletions
|
|
@ -1,21 +1,31 @@
|
|||
import type { Input } from './input';
|
||||
import { warning } from '@actions/core';
|
||||
|
||||
class Docker {
|
||||
export class Docker {
|
||||
private static readonly image = 'ghcr.io/renovatebot/renovate';
|
||||
private static readonly version = 'latest';
|
||||
|
||||
private readonly dockerImage: string;
|
||||
private readonly fullTag: string;
|
||||
|
||||
constructor(input: Input) {
|
||||
const tag = input.getVersion();
|
||||
let image = input.getDockerImage();
|
||||
let version = input.getVersion();
|
||||
|
||||
this.dockerImage = input.getDockerImage() ?? Docker.image;
|
||||
this.fullTag = tag ?? 'latest';
|
||||
if (!image) {
|
||||
warning(`No Docker image specified, using ${Docker.image}`);
|
||||
image = Docker.image;
|
||||
}
|
||||
if (!version) {
|
||||
warning(`No Docker version specified, using ${Docker.version}`);
|
||||
version = Docker.version;
|
||||
}
|
||||
|
||||
this.dockerImage = image;
|
||||
this.fullTag = version;
|
||||
}
|
||||
|
||||
image(): string {
|
||||
return `${this.dockerImage}:${this.fullTag}`;
|
||||
}
|
||||
}
|
||||
|
||||
export default Docker;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue