Skip to content

Commit 3f43cda

Browse files
skip: merge (fde0305) [skip release]
2 parents 77b80f4 + fde0305 commit 3f43cda

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

src/index.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
1+
import { group, notice, setFailed } from '@actions/core';
12
import { Input } from './input';
23
import { Renovate } from './renovate';
3-
import { setFailed } from '@actions/core';
44

55
async function run(): Promise<void> {
66
try {
77
const input = new Input();
88
const renovate = new Renovate(input);
99

10+
await group('Check Renovate version', async () => {
11+
const version = await renovate.runDockerContainerForVersion();
12+
notice(version, { title: 'Renovate CLI version' });
13+
});
14+
1015
await renovate.runDockerContainer();
1116
} catch (error) {
1217
console.error(error);

src/renovate.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
import { exec, getExecOutput } from '@actions/exec';
12
import { Docker } from './docker';
23
import { Input } from './input';
3-
import { exec } from '@actions/exec';
44
import fs from 'node:fs/promises';
55
import path from 'node:path';
66

@@ -14,6 +14,17 @@ export class Renovate {
1414
this.docker = new Docker(input);
1515
}
1616

17+
async runDockerContainerForVersion(): Promise<string> {
18+
const command = `docker run -t --rm ${this.docker.image()} --version`;
19+
20+
const { exitCode, stdout } = await getExecOutput(command);
21+
if (exitCode !== 0) {
22+
new Error(`'docker run' failed with exit code ${exitCode}.`);
23+
}
24+
25+
return stdout.trim();
26+
}
27+
1728
async runDockerContainer(): Promise<void> {
1829
await this.validateArguments();
1930

0 commit comments

Comments
 (0)