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

fix: no message is posted on skip #130

Merged
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
10 changes: 4 additions & 6 deletions src/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,20 @@ export async function run() {
const { eventPayload, eventName } = program;
if (eventName === "issues.closed") {
if (eventPayload.issue.state_reason !== "completed") {
const result = logger.info("Issue was not closed as completed. Skipping.");
await githubCommentModuleInstance.postComment(result?.logMessage.diff || "");
return result?.logMessage.raw;
return logger.info("Issue was not closed as completed. Skipping.").logMessage.raw;
}
const issue = parseGitHubUrl(eventPayload.issue.html_url);
const activity = new IssueActivity(issue);
await activity.init();
if (configuration.incentives.requirePriceLabel && !getSortedPrices(activity.self?.labels).length) {
const result = logger.error("No price label has been set. Skipping permit generation.");
await githubCommentModuleInstance.postComment(result?.logMessage.diff || "");
return result?.logMessage.raw;
await githubCommentModuleInstance.postComment(result.logMessage.diff);
return result.logMessage.raw;
}
const processor = new Processor();
await processor.run(activity);
return processor.dump();
} else {
return logger.error(`${eventName} is not supported, skipping.`)?.logMessage.raw;
return logger.error(`${eventName} is not supported, skipping.`).logMessage.raw;
}
}
Loading