How to use the gitlab.Gitlab function in gitlab

To help you get started, we’ve selected a few gitlab examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github netlify / staticgen / scripts / repos.js View on Github external
function authenticate({ gitHubToken, gitLabToken }) {
  octokit = Octokit()
  octokit.authenticate({ type: 'token', token: gitHubToken })
  gitlab = new Gitlab({ personaltoken: gitLabToken })
}
github netlify / staticgen / scripts / fetch-archive.js View on Github external
function init(tokens) {
  github = githubInit(tokens.githubToken)
  gitlab = new Gitlab({ personaltoken: tokens.gitlabToken })
  getTwitterFollowers = twitterFollowersCount({
    consumer_key: tokens.twitterConsumerKey,
    consumer_secret: tokens.twitterConsumerSecret,
    access_token_key: tokens.twitterAccessTokenKey,
    access_token_secret: tokens.twitterAccessTokenSecret,
  })
}
github paulrobertlloyd / indiekit / packages / publisher-gitlab / lib / update-file.js View on Github external
module.exports = async (opts, path, content, message) => {
  const gitlab = new Gitlab({
    host: opts.instance,
    token: opts.token
  });

  content = Buffer.from(content).toString('base64');
  const response = await gitlab.RepositoryFiles.edit(
    opts.projectId,
    path,
    opts.branch,
    content,
    message, {
      encoding: 'base64'
    }
  ).catch(error => {
    throw new Error(error);
  });
github netlify / netlify-cms / cypress / plugins / gitlab.js View on Github external
function getGitLabClient(token) {
  const client = new Gitlab({
    token,
  });

  return client;
}
github danger / danger-js / source / platforms / gitlab / GitLabAPI.ts View on Github external
constructor(public readonly repoMetadata: RepoMetaData, public readonly repoCredentials: GitLabAPICredentials) {
    this.fetch = fetch
    this.api = new Gitlab(repoCredentials)
    this.hostURL = repoCredentials.host
  }
github paulrobertlloyd / indiekit / packages / publisher-gitlab / lib / create-file.js View on Github external
module.exports = async (opts, path, content, message) => {
  const gitlab = new Gitlab({
    host: opts.instance,
    token: opts.token
  });

  content = Buffer.from(content).toString('base64');
  const response = await gitlab.RepositoryFiles.create(
    opts.projectId,
    path,
    opts.branch,
    content,
    message, {
      encoding: 'base64'
    }
  ).catch(error => {
    throw new Error(error);
  });

gitlab

Full NodeJS implementation of the GitLab API. Supports Promises, Async/Await.

MIT
Latest version published 5 years ago

Package Health Score

65 / 100
Full package analysis