Skip to content

Commit

Permalink
Extend action, add support of local actions
Browse files Browse the repository at this point in the history
  • Loading branch information
dmvict committed Jan 9, 2025
1 parent 747fa37 commit 0db20fb
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/Retry.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,23 @@ function retry( scriptType )

process.env.RETRY_ACTION = actionName;
const token = core.getInput( 'github_token' );
const remoteActionPath = common.remotePathForm( actionName, token );
const localActionDir = _.path.nativize( _.path.join( __dirname, '../../../', remoteActionPath.repo ) );

const localIs = actionName.startsWith( './' );

let remoteActionPath = null;
if( !localIs )
remoteActionPath = common.remotePathForm( actionName, token );

const localActionDir = localIs ?
_.path.nativize( _.path.join( process.env.GITHUB_WORKSPACE, actionName ) ) :
_.path.nativize( _.path.join( __dirname, '../../../', remoteActionPath.repo ) );

if( !localIs )
con.then( () => common.actionClone( localActionDir, remoteActionPath ) );

con.then( () =>
{
const actionFileDir = _.path.nativize( _.path.join( localActionDir, remoteActionPath.localVcsPath ) );
const actionFileDir = localIs ? localActionDir : _.path.nativize( _.path.join( localActionDir, remoteActionPath.localVcsPath ) );
const config = common.actionConfigRead( actionFileDir );

if( common.shouldExit( config, scriptType ) )
Expand Down

0 comments on commit 0db20fb

Please sign in to comment.