Skip to content

Commit

Permalink
refactor: #18
Browse files Browse the repository at this point in the history
  • Loading branch information
raunakgurud09 committed Jan 31, 2024
1 parent e4a8029 commit fa26d89
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -59384,11 +59384,11 @@ async function run() {
(0, core_1.setSecret)(hashnode_key);
const response = await (0, controller_1.getUser)(hashnode_key);
console.log(response);
if (response.error) {
if (response.errors) {
(0, core_1.setOutput)("result_json", response.data);
const summary = `Invalid hashnode_key ${hashnode_key}`;
const summary = `Invalid hashnode_key ${response === null || response === void 0 ? void 0 : response.errors[0].message}`;
(0, core_1.setOutput)("result_summary", summary);
(0, core_1.setOutput)("result_info", response.error);
(0, core_1.setOutput)("result_info", response.errors);
process.exit(1);
}
console.log(`Welcome ${response.me.name} to this action`);
Expand Down
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ export async function run() {

console.log(response);

if (response.error) {
if (response.errors) {
setOutput("result_json", response.data);
const summary = `Invalid hashnode_key ${hashnode_key}`;
const summary = `Invalid hashnode_key ${response?.errors[0].message}`;
setOutput("result_summary", summary);
setOutput("result_info", response.error);
setOutput("result_info", response.errors);

process.exit(1);
}
Expand Down

0 comments on commit fa26d89

Please sign in to comment.