mirror of
https://github.com/renovatebot/github-action.git
synced 2025-12-16 17:02:36 +00:00
feat!: use semantic release (#704)
This commit is contained in:
parent
8463758e93
commit
94faa7df1e
9 changed files with 2317 additions and 389 deletions
|
|
@ -1,24 +1,21 @@
|
|||
import type { Input } from './input';
|
||||
|
||||
// renovate: datasource=docker depName=renovate/renovate versioning=docker
|
||||
const tag = '35.2.0-slim';
|
||||
|
||||
class Docker {
|
||||
private static readonly repository = 'renovate/renovate';
|
||||
private static readonly tagSuffix = '-slim';
|
||||
private readonly fullTag: string;
|
||||
|
||||
constructor(input: Input) {
|
||||
this.fullTag = input.useSlim() ? tag : tag.replace(Docker.tagSuffix, '');
|
||||
const tag = input.getVersion();
|
||||
this.fullTag = input.useSlim()
|
||||
? tag
|
||||
? `${tag}-slim`
|
||||
: 'slim'
|
||||
: tag ?? 'latest';
|
||||
}
|
||||
|
||||
image(): string {
|
||||
return `${Docker.repository}:${this.fullTag}`;
|
||||
}
|
||||
|
||||
static version(): string {
|
||||
return tag.replace(Docker.tagSuffix, '');
|
||||
}
|
||||
}
|
||||
|
||||
export default Docker;
|
||||
|
|
|
|||
|
|
@ -1,4 +0,0 @@
|
|||
import * as core from '@actions/core';
|
||||
import Docker from './docker';
|
||||
|
||||
core.setOutput('version', Docker.version());
|
||||
15
src/input.ts
15
src/input.ts
|
|
@ -27,11 +27,11 @@ class Input {
|
|||
|
||||
constructor() {
|
||||
const envRegexInput = core.getInput('env-regex');
|
||||
const envRegex = envRegexInput ? new RegExp(envRegexInput) : this.options.envRegex;
|
||||
const envRegex = envRegexInput
|
||||
? new RegExp(envRegexInput)
|
||||
: this.options.envRegex;
|
||||
this._environmentVariables = new Map(
|
||||
Object.entries(process.env).filter(([key]) =>
|
||||
envRegex.test(key)
|
||||
)
|
||||
Object.entries(process.env).filter(([key]) => envRegex.test(key))
|
||||
);
|
||||
|
||||
this.token = this.get(
|
||||
|
|
@ -58,7 +58,12 @@ class Input {
|
|||
}
|
||||
|
||||
useSlim(): boolean {
|
||||
return core.getInput(`useSlim`) !== 'false';
|
||||
return core.getInput('useSlim') !== 'false';
|
||||
}
|
||||
|
||||
getVersion(): string | null {
|
||||
const version = core.getInput('renovate-version');
|
||||
return !!version && version !== '' ? version : null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue