@codefresh-io/cf-git-providers
TypeScript icon, indicating that this package has built-in type declarations

0.15.3 • Public • Published

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)
	}
})()

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.5.0-CR-14399-20develop
0.4.4-CR-10173-30beta
0.15.3118latest

Version History

VersionDownloads (Last 7 Days)Published
0.15.3118
0.15.22
0.15.11
0.15.01
0.14.312
0.14.25
0.14.10
0.14.033
0.13.40
0.13.30
0.13.20
0.13.10
0.13.00
0.12.20
0.12.10
0.12.00
0.11.50
0.11.40
0.11.30
0.11.20
0.11.10
0.11.00
0.10.10
0.10.00
0.9.30
0.9.20
0.9.10
0.9.00
0.8.50
0.8.40
0.8.30
0.8.20
0.8.10
0.7.20
0.7.10
0.7.00
0.6.10
0.6.00
0.5.10
0.5.00
0.4.270
0.5.0-CR-14399-20
0.5.0-CR-143990
0.4.260
0.4.250
0.4.240
0.4.230
0.4.220
0.4.210
0.4.200
0.4.190
0.4.180
0.4.170
0.4.160
0.4.150
0.4.140
0.4.130
0.4.120
0.4.110
0.4.100
0.4.90
0.4.80
0.4.70
0.4.60
0.4.50
0.4.40
0.4.4-CR-10173-30
0.4.4-CR-101730-20
0.4.4-CR-101730
0.4.30
0.4.20
0.4.10
0.4.00
0.3.10
0.3.00
0.2.10
0.2.00
0.1.60
0.1.50
0.1.40
0.1.30
0.1.20
0.1.10
0.1.00
0.0.460
0.0.450
0.0.440
0.0.430
0.0.420
0.0.410
0.0.400
0.0.390
0.0.380
0.0.370
0.0.360
0.0.350
0.0.340
0.0.330
0.0.320
0.0.310
0.0.300
0.0.280
0.0.270
0.0.260
0.0.250
0.0.240
0.0.230
0.0.220
0.0.210
0.0.200
0.0.190
0.0.180
0.0.170
0.0.160
0.0.150
0.0.140
0.0.130
0.0.120
0.0.110
0.0.100
0.0.90
0.0.80
0.0.70
0.0.60
0.0.40

Package Sidebar

Install

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

Weekly Downloads

172

Version

0.15.3

License

MIT

Unpacked Size

438 kB

Total Files

107

Last publish

Collaborators

  • plakyda-codefresh
  • z-tikhonov-codefresh
  • denis-codefresh
  • yaroslav-codefresh
  • scme0
  • atgardner
  • mikeshl
  • bohdan.pisarenko
  • ilia-medvedev-codefresh
  • vasil-s
  • vitalii.chyrka
  • noam-codefresh
  • oleksandr-codefresh
  • andrii-codefresh
  • codefresh
  • gil-levkovitch
  • bogdan-volynets
  • kimaharfi
  • eticodefresh
  • vadim-kharin-codefresh
  • ziv_levi
  • alina_yablochnikova