-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(refactor): use named imports (#879)
Allows better tree shaking while bundling.
- Loading branch information
Showing
7 changed files
with
77 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters