Skip to content

Commit e1e7d7f

Browse files
committed
fix: nested JSON
1 parent 6e23fd1 commit e1e7d7f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

.github/workflows/docker.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,20 +85,20 @@ jobs:
8585
const { resolve } = require('node:path');
8686
const { inspect } = require('node:util');
8787
const { Buffer } = require('node:buffer');
88-
const inputs = `${{ toJSON(github.event.inputs) }}`;
88+
const inputs = `${{ toJSON(github.event.inputs) }}`.
89+
replace(/"platform":\s*"\[(.+)\]",/i, /"platform": [$1],/);
8990
const opt = {input:{}, dot:{}};
9091
9192
try{
9293
if(inputs.length > 0){
93-
inputs = inputs.replace(/"platform":\s*"\[(.+)\]",/i, /"platform": [$1],/);
9494
opt.input = JSON.parse(inputs);
9595
if(opt.input?.etc){
9696
opt.input.etc = JSON.parse(Buffer.from(opt.input.etc, 'base64').toString('ascii'));
9797
}
9898
}
9999
}catch(e){
100-
core.warning('could not parse github.event.inputs', e);
101-
core.warning("${{ github.event.inputs }}");
100+
core.warning('could not parse github.event.inputs');
101+
core.warning(inputs);
102102
}
103103
104104
try{

0 commit comments

Comments
 (0)