File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed
Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change 1+ import { group , notice , setFailed } from '@actions/core' ;
12import { Input } from './input' ;
23import { Renovate } from './renovate' ;
3- import { setFailed } from '@actions/core' ;
44
55async 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 ) ;
Original file line number Diff line number Diff line change 1+ import { exec , getExecOutput } from '@actions/exec' ;
12import { Docker } from './docker' ;
23import { Input } from './input' ;
3- import { exec } from '@actions/exec' ;
44import fs from 'node:fs/promises' ;
55import 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
You can’t perform that action at this time.
0 commit comments