Skip to content

Commit

Permalink
Merge pull request #10 from MtMath/fix-github-process
Browse files Browse the repository at this point in the history
fix(GitHub): process exit when invalid token
  • Loading branch information
MatheusMoura17 committed Apr 2, 2024
2 parents 21348b6 + 833cf30 commit 02c565b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/modules/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Octokit } from "@octokit/rest";

export const createGitHubRepo = async (data: Record<string, any>) => {

if(data.enableGit === false) return "";
if(!data.enableGit) return "";
const token = data.GITHUB_ACCESS_TOKEN;
const repoName = data.repoName;

Expand All @@ -15,8 +15,8 @@ export const createGitHubRepo = async (data: Record<string, any>) => {

return response.data.clone_url;
} catch (error) {
console.error(`Error when create repository on GitHub: ${error}`);
process.exit(1);
console.error(`Skipped - create repository on GitHub: ${error}`);
return ""
}
};

0 comments on commit 02c565b

Please sign in to comment.