@@ -1303,20 +1303,23 @@ async function run() {
13031303 // const awesomeCiName = actionsPath + "/awesome-ci"
13041304 // Download awesome-ci
13051305 const repo = "fullstack-devops/awesome-ci" ;
1306- const downloadUrl = `https://github.com/${ repo } /releases/download/${ wantedVersion } /awesome-ci_${ wantedVersion } _${ wantedArch } ` ;
1307- // const file = fs.createWriteStream(awesomeCiName);
1308- // core.info(`Acquiring ${info.resolvedVersion} from ${info.downloadUrl}`);
1309- const downloadPath = await tc . downloadTool ( downloadUrl , undefined ) ;
1310- core . info ( `downloaded awesome-ci to ${ downloadPath } ` ) ;
1311- fs . rename ( downloadPath + "/awesome-ci*" , "awesome-ci" , ( err ) => {
1306+ const aciName = `awesome-ci_${ wantedVersion } _${ wantedArch } ` ;
1307+ const newAciLoc = `${ process . env . HOME } /bin` ;
1308+ const newAciLocFile = path . join ( newAciLoc , 'awesome-ci' ) ;
1309+ console . log ( newAciLoc ) ;
1310+ const downloadUrl = `https://github.com/${ repo } /releases/download/${ wantedVersion } /${ aciName } ` ;
1311+ const downloadPath = await tc . downloadTool ( downloadUrl , newAciLocFile ) ;
1312+ core . info ( `downloaded awesome-ci to ${ newAciLocFile } ` ) ;
1313+ core . info ( 'Adding to the cache ...' ) ;
1314+ const cachedDir = await tc . cacheDir ( newAciLoc , 'awesome-ci' , wantedVersion ) ;
1315+ core . info ( `Successfully cached awesome-ci to ${ cachedDir } ` ) ;
1316+ fs . chmod ( `${ cachedDir } /awesome-ci` , 0o777 , ( err ) => {
13121317 if ( err )
13131318 throw core . error ( err ) ;
1314- core . info ( 'successfully renamed awesome-ci!' ) ;
1319+ core . info ( 'successfully add access rights to awesome-ci!' ) ;
13151320 } ) ;
1316- const extPath = path . join ( downloadPath , 'awesome-ci' ) ;
1317- core . info ( 'Adding to the cache ...' ) ;
1318- const cachedDir = await tc . cacheDir ( extPath , 'awesome-ci' , wantedVersion ) ;
1319- core . info ( `Successfully cached awesome-ci to ${ cachedDir } ` ) ;
1321+ core . addPath ( cachedDir ) ;
1322+ core . info ( 'Added awesome-ci to the path' ) ;
13201323}
13211324run ( ) ;
13221325
0 commit comments