Skip to content

A Nodejs CLI tool to verify/update the current version of a dependency used in a public/private github repository mentioned in a CSV file

Notifications You must be signed in to change notification settings

dystopiadroid/pkg-ver-tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pkg-ver-tracker

-------------------------------------Edit : Now available on npm registry ----------------------------------------------

CLI tool to verify/update the current version of a dependency used in a public/private github repository mentioned in a CSV file

Basic Usage

https://www.npmjs.com/package/pkg-ver-tracker

1) To compare install the cli tool

  npx pkg-ver-tracker 

2) To compare the version of dependency in the repository with respect to the specified dependency in the argument.

  npx pkg-ver-tracker -i <CSV-file> <dep@version>

3) Steps to generate personal access token from github :

  a) Click on your profile and go to settings.

  b) In the left sidebar click on developer settings.

  c) Select personal access tokens.

  d) Generate a new token and copy the token ID.

4) Make sure that you create an environment variable named MY_API_KEY that holds the github auth token

  export MY_API_KEY=<github-token>

5) To generate pull request for the repositories whose dependency have lower version with respect to the dependency in the argument

( Note : This will only work if you've set MY_API_KEY env variable equal to your github Personal access token as mentioned below. )

  npx pkg-ver-tracker -update -i <CSV-file> <dep@version>

image

image

image

Pull Request : https://github.com/dyte-in/javascript-sample-app/pull/390

NOTE : My npm publishing got restricted for certain time that's why I was not able to put the pkg-ver-tracker tool here before 11:30 PM.

Using my pkg-ver-tracker tool from npm registry

https://www.npmjs.com/package/pkg-ver-tracker

image

image

Pull Request : bala2509/Test#21

Github APIs used

Create a fork

  POST repos/{owner}/{repo}/forks
Parameter Type Description
owner string Required. Account owner of repository
repo string Required. Name of the repository

Get Branches

  GET /repos/{owner}/{repo}/branches
Parameter Type Description
owner string Required. Account owner of repository
repo string Required. Name of the repository

Create a new branch

  POST /repos/{owner}/{repo}/git/refs
Parameter Type Description
owner string Required. Account owner of repository
repo string Required. Name of the repository
ref string Required. Name of fully qualified reference ( ref/heads/featureA )
sha string Required. The SHA1 value for this reference

Get content from repository

  GET /repos/{owner}/{repo}/contents/{path}
Parameter Type Description
owner string Required. Account owner of repository
repo string Required. Name of the repository
path string Required. Path parameter

Update content from repository

  PUT /repos/{owner}/{repo}/contents/{path}
Parameter Type Description
owner string Required. Account owner of repository
repo string Required. Name of the repository
path string Required. Path parameter
message string Required. Commit message
committer.name string Required. Name of the author or committer
committer.email string Required. Email of the author or committer
content string Required. THe new files content (base64 encoded)

Create pull request

  POST /repos/{owner}/{repo}/pulls
Parameter Type Description
owner string Required. Account owner of repository
repo string Required. Name of the repository
title string Required. The title of new pull request
body string Required. Contents of the pull request
head string Required. The name of the branch where your changes are implemented
base string Required. The name of the branch you want the changes pulled into

About

A Nodejs CLI tool to verify/update the current version of a dependency used in a public/private github repository mentioned in a CSV file

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published