feat: fix syntax error

This commit is contained in:
Joel Male 2024-03-28 12:51:03 +10:00
parent 3af123dc1e
commit a976623266
4 changed files with 11 additions and 7 deletions

5
dist/index.js vendored
View file

@ -76,8 +76,9 @@ function run() {
: process.env.insecure
? process.env.insecure == 'true'
: false;
if (process.env.github_event && body) {
const decodedBody = JSON.parse(body);
const githubEvent = core.getInput('github_event') == 'true';
if (githubEvent) {
const decodedBody = JSON.parse(body || '{}');
decodedBody.github_event = github_1.context;
body = JSON.stringify(decodedBody);
}

5
dist/main.js vendored
View file

@ -34,8 +34,9 @@ function run() {
: process.env.insecure
? process.env.insecure == 'true'
: false;
if (process.env.github_event && body) {
const decodedBody = JSON.parse(body);
const githubEvent = core.getInput('github_event') == 'true';
if (githubEvent) {
const decodedBody = JSON.parse(body || '{}');
decodedBody.github_event = github_1.context;
body = JSON.stringify(decodedBody);
}

2
dist/main.js.map vendored
View file

@ -1 +1 @@
{"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAqC;AACrC,iCAA2B;AAC3B,4CAAuC;AAEvC,SAAe,GAAG;;QAChB,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;YAC9B,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;YACtB,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW;gBACvB,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW;gBACzB,CAAC,CAAC,EAAE,CAAA;QAER,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC;YACtC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC;YAC1B,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO;gBACnB,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO;gBACrB,CAAC,CAAC,IAAI,CAAA;QAEV,IAAI,IAAI,GAAG,IAAI,CAAC,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IACN,CAAC;CAAA;AAED,SAAS,KAAK,CAAC,UAAU;IAEvB,IAAI,CAAC,SAAS,CAAC,yBAAyB,UAAU,EAAE,CAAC,CAAA;IAErD,MAAM,IAAI,KAAK,CAAC,oCAAoC,UAAU,EAAE,CAAC,CAAA;AACnE,CAAC;AAED,GAAG,EAAE,CAAA"}

View file

@ -27,10 +27,12 @@ async function run() {
? process.env.insecure == 'true'
: false
const githubEvent = core.getInput('github_event') == 'true'
// if github_event is set to true, append it to the body
if (process.env.github_event && body) {
if (githubEvent) {
// decode the body
const decodedBody = JSON.parse(body)
const decodedBody = JSON.parse(body || '{}')
// set the github event
decodedBody.github_event = context