Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
) {
console.log('\n\nYou have to enter your GitLab url in the settings.js file.');
process.exit(1);
}
if (
!settings.gitlab.token ||
settings.gitlab.token === '{{gitlab private token}}'
) {
console.log(
'\n\nYou have to enter your GitLab private token in the settings.js file.'
);
process.exit(1);
}
// Create a GitLab API object
const gitlabApi = new Gitlab({
url: settings.gitlab.url,
token: settings.gitlab.token,
});
// Create a GitHub API object
const githubApi = new GitHubApi({
debug: false,
baseUrl: settings.github.baseUrl
? settings.github.baseUrl
: 'https://api.github.com',
timeout: 5000,
headers: {
'user-agent': 'node-gitlab-2-github', // GitHub is happy with a unique user agent
accept: 'application/vnd.github.v3+json',
},
});
constructor({ info = {}, config }) {
this.info = info
this.config = config
this.api = new GitLabAPI({
url: this.config.baseUrl,
token: this.config.accessToken
})
}