Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added with_base64_encoded for complex strings like json to prevent parsing errors. #63

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/Common.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,18 @@ function actionConfigRead( actionDir )

//

function actionOptionsParse( src )
function actionOptionsParse( src, base64Encoded )
{
const result = Object.create( null );
for( let i = 0 ; i < src.length ; i++ )
{
const splits = _.strStructureParse({ src : src[ i ], toNumberMaybe : 0 });
if(base64Encoded) {
for (const [key, value] of Object.entries(splits)) {
let buff = new Buffer.from(value, 'base64').toString('ascii');
splits[key] = buff;
}
}
_.map.extend( result, splits );
}
return result;
Expand Down
3 changes: 3 additions & 0 deletions src/Retry.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ function retry( scriptType )
return null;

const optionsStrings = core.getMultilineInput( 'with' );
const optionsStringsBase64Encoded = core.getMultilineInput( 'with_base4_encoded' );
const options = common.actionOptionsParse( optionsStrings );
const optionsBase64Encoded = common.actionOptionsParse( optionsStringsBase64Encoded, true );
_.map.extend( options, optionsBase64Encoded );
_.map.sureHasOnly( options, config.inputs );

if( _.strBegins( config.runs.using, 'node' ) )
Expand Down