Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async getGitlabLastCommit({ url, branchName = 'master', token = null }) {
const { host, owner, repo } = this._parseGithubUrlRepo(url);
const services = new ProjectsBundle({
host,
token
});
const lastCommit = await services.Commits.all(`${owner}/${repo}`, {
perPage: 1,
maxPages: 1,
showPagination: true,
ref_name: branchName
});
return lastCommit.data[0];
}