Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@codefresh-io/cf-git-providers

Package Overview
Dependencies
Maintainers
0
Versions
112
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@codefresh-io/cf-git-providers

An NPM module/CLI for interacting with various git providers

  • 0.12.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
301
decreased by-37.55%
Maintainers
0
Weekly downloads
 
Created
Source

cf-git-providers

An NPM module/CLI for interacting with various git providers

Using the CLI

Install

In case you have node.js installed you can easily install with NPM:

npm install -g @codefresh-io/cf-git-providers

Or you can run it as a Docker container:

docker run -it --rm --entrypoint "sh" codefresh/cgp

Authenticate

To use the cli tool you will need to provide it with a Codefresh git context which you can get by using the codefresh-cli:

codefresh get context <context-name> -o json --decrypt | base64

Then, to provide this value to the cli by adding it to each command with the flag --git-context or (preferably) by exporting the CF_GIT_CONTEXT environment variable, example:

export CF_GIT_CONTEXT=$(codefresh get context <context-name> -o json --decrypt | base64)

Usage

Examples:

  • To get the list of repositories for a specific owner:

    cgp list repos --owner codefresh-io

  • To create a repository webhook:

    cgp create webhook --owner codefresh-io --repo cli --endpoint http://example.com --secret some-secret

Using the npm module

Install

With npm:

npm install @codefresh-io/cf-git-providers

With yarn:

yarn add @codefresh-io/cf-git-providers

Usage

import { getProviderByContext } from '@codefresh-io/cf-git-providers'

(async function () {
	try {
		const provider = await getProviderByContext(gitContext, providerOptions)
		const fileContents = await provider.fetchRawFile({ owner, repo, ref, path })
		console.log(fileContents)
	} catch (error) {
		console.error(error)
	}
})()

Keywords

FAQs

Package last updated on 18 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc