How to use github-url-to-object - 8 common examples

To help you get started, we’ve selected a few github-url-to-object 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 isomorphic-git / isomorphic-git / for-future.js View on Github external
async clone(url) {
    await init(this.gitdir);
    // await addRemote()
    await GithubFetch({
      gitdir: this.gitdir,
      // TODO: make this not Github-specific
      user: ghurl(url).user,
      repo: ghurl(url).repo,
      ref: ghurl(url).branch,
      remote: this.operateRemote,
      token: this.operateToken
    });
    await checkout({
      workdir: this.workdir,
      gitdir: this.gitdir,
      // TODO: make this not Github-specific
      ref: ghurl(url).branch,
      remote: this.operateRemote
    });
  }
  async list() {
github gusgard / add-stars / lib / gh.js View on Github external
return new Promise((resolve, reject) => {
      if (repository && 'url' in repository) {
        let ghObject = gh(repository.url);
        let repoName = `${ghObject.user}/${ghObject.repo}`;
        if (!this.repos.has(repoName)) {
          this.repos.add(repoName);
          setTimeout(()=> {
            this.ghme.star(repoName, error => {
              this.total++;
              if (!error) {
                this.success++;
                console.log('✅  ' + colors.yellow('Add ⭐  to ')+colors.yellow.underline(repoName));
              } else {
                this.errors++;
                // let data = { repo: repoName, message: error.message, code: error.statusCode };
                console.log(`❌  ${colors.yellow('Add ⭐  to ')} ${colors.yellow.underline(repoName)} ${colors.red(` error: ${error.message}`)}`);
              }
              resolve(this.total);
            });
github isomorphic-git / isomorphic-git / for-future.js View on Github external
async clone(url) {
    await init(this.gitdir);
    // await addRemote()
    await GithubFetch({
      gitdir: this.gitdir,
      // TODO: make this not Github-specific
      user: ghurl(url).user,
      repo: ghurl(url).repo,
      ref: ghurl(url).branch,
      remote: this.operateRemote,
      token: this.operateToken
    });
    await checkout({
      workdir: this.workdir,
      gitdir: this.gitdir,
      // TODO: make this not Github-specific
      ref: ghurl(url).branch,
      remote: this.operateRemote
    });
  }
  async list() {
github AlexKVal / release-script / src / release.js View on Github external
console.log('Releasing: '.cyan + 'bower package'.green);
      releaseAdRepo(bowerRepo, bowerRoot, tmpBowerRepo, vVersion);
      console.log('Released: '.cyan + 'bower package'.green);
    } else {
      console.log('The "bowerRepo" is not set in package.json. Skipping Bower package publishing.'.yellow);
    }
    // bower (register package if bower.json is located in this repo)
    if (bowerjson) {
      if (bowerjson.private) {
        console.log('Package is private, skipping bower registration'.yellow);
      } else if (!which('bower')) {
        console.log('Bower is not installed globally, skipping bower registration'.yellow);
      } else {
        console.log('Registering: '.cyan + 'bower package'.green);

        const output = safeRun(`bower register ${bowerjson.name} ${gh(repo).clone_url}`, true);

        if (output.indexOf('EDUPLICATE') > -1) {
          console.log('Package already registered'.yellow);
        } else if (output.indexOf('registered successfully') < 0) {
          console.log('Error registering package, details:'.red);
          console.log(output.red);
        } else {
          console.log('Registered: '.cyan + 'bower package'.green);
        }
      }
    }
  }

  // documents site
  if (!isPrivate && docsRepo && (!preid || argv.onlyDocs)) {
    console.log('Releasing: '.cyan + 'documents site'.green);
github isomorphic-git / isomorphic-git / for-future.js View on Github external
async clone(url) {
    await init(this.gitdir);
    // await addRemote()
    await GithubFetch({
      gitdir: this.gitdir,
      // TODO: make this not Github-specific
      user: ghurl(url).user,
      repo: ghurl(url).repo,
      ref: ghurl(url).branch,
      remote: this.operateRemote,
      token: this.operateToken
    });
    await checkout({
      workdir: this.workdir,
      gitdir: this.gitdir,
      // TODO: make this not Github-specific
      ref: ghurl(url).branch,
      remote: this.operateRemote
    });
  }
  async list() {
github hahnlee / kodocs.io / src / components / ReadMe / ReadMe.js View on Github external
fetchReadMe() {
    const { repository } = this.props;
    const { user: owner, repo } = gh(repository.url);
    const github = octokit({});

    const opts = {
      owner,
      repo,
      headers: {
        Accept: 'application/vnd.github.v3.html',
      },
    };

    github.repos.getReadme(opts)
      .then(({ data }) => this.setState({
        isLoading: false,
        data,
      }))
      .catch(error => this.setState({
github mosjs / mos / packages / mos-processor / src / get-markdown-meta / index.ts View on Github external
.then(result => {
      const pkg = result.pkg

      if (!pkg) {
        return {}
      }

      return {
        pkg,
        pkgRoot: path.dirname(result.path),
        repo: pkg.repository && pkg.repository.url && gh(pkg.repository.url),
      }
    })
    .then(opts => Object.assign(opts, {filePath}))
github mvila / npm-addict / backend / fetcher.js View on Github external
return undefined;
      }
      const createdOn = new Date(npmResult.created);

      if (!npmResult.modified) {
        this.app.log.warning(`Package '${name}' doesn't have an updated date`);
        return undefined;
      }
      const updatedOn = new Date(npmResult.modified);

      const npmURL = this.npmWebsitePackageURL + name;

      let gitHubResult, parsedGitHubURL, gitHubURL;
      if (npmResult.repository) {
        if (npmResult.repository.includes('github')) {
          parsedGitHubURL = parseGitHubURL(npmResult.repository);
          if (parsedGitHubURL) {
            gitHubURL = parsedGitHubURL.https_url;
            gitHubResult = await this.fetchGitHubRepository(parsedGitHubURL.user, parsedGitHubURL.repo);
          } else {
            this.app.log.debug(`'${name}' package has an invalid GitHub URL (${npmResult.repository})`);
          }
        } else {
          this.app.log.debug(`'${name}' package has a respository not hosted by GitHub (${npmResult.repository})`);
        }
      } else {
        this.app.log.debug(`'${name}' package doesn't have a respository field`);
      }

      let gitHubStars, gitHubPackageJSON, gitHubPackageJSONPath;
      if (gitHubResult) {
        let defaultPath = currentPackage && currentPackage.gitHubPackageJSONPath;

github-url-to-object

Extract user, repo, and other interesting properties from GitHub URLs

MIT
Latest version published 3 years ago

Package Health Score

53 / 100
Full package analysis

Popular github-url-to-object functions