Skip to content

Commit

Permalink
feat: fix syntax error
Browse files Browse the repository at this point in the history
  • Loading branch information
joelwmale committed Mar 28, 2024
1 parent 3af123d commit a976623
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
5 changes: 3 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
5 changes: 3 additions & 2 deletions dist/main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/main.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a976623

Please sign in to comment.