@rove-team/gitsheet

This project is an gitlab issue handler

Usage no npm install needed!

<script type="module">
  import roveTeamGitsheet from 'https://cdn.skypack.dev/@rove-team/gitsheet';
</script>

README

Git Sheet

Introduction

Gitsheet is a package to bring your git issues into a google spreadsheet. To take a quick looking at your issues' status or share it with your customer(s).

Installation

To install it as an NPM package, you should use the following command:

npm i @rove-team/gitsheet

How to create private key and client email

Before using this package, you need to create a google-client-email and a google-private-key. Use the following steps to make these two:

  1. Go to Google Cloud
  2. Click onCreate Project to create a new project or use an already created one.
  3. Then from the left-side panel, click on APIs & Services > Credentials.
  4. Next to the Google Cloud Platform text at the header navigation, make sure you are in the right project.
  5. Click on Create Credentials and choose Service account. Then fill out the form and click on the Create button.
  6. Click on Done and that's it. Your client-email is created.
  7. Now in the APIs & Services > Credentials page, in the Service Accounts part, you can see your created client-email. Click on it.
  8. On the opened page, click on Add Key > Create new key and choose the JSON format.
  9. In the created JSON file, you can see your client-email and private-key.
  10. Don't forget to share your required spreadsheet documents with this created client-email.
  11. Also, you should Enable Google Sheet API for your google cloud account.

How to create GIT access token

Creating access tokens could be different in each GIT application. So you can see the following link to know how to make an access token for each one:

Create project information sheet

The next step is creating a new google spreadsheet for your project information. Also, you have to share it with your previously created google client-email.

The following headers with the same spell are required for your spreadsheet:

  • Project Title This column is for your project title, which could be anything meaningful for yourself. This name does not have any impact on your results.
  • Project ID In this column, you should write the project ID of your git repository.
  • Sheet ID For each project, you should create a google spreadsheet and share it with your client email. Then put its ID in this column.
  • Maximum Closed Show Days The number in this column is the maximum number of days that an issue had been closed. So the issues being closed for more days than this number would not be in the results.
  • Show Milestone In this column, you should add a simple checkbox. Checking this checkbox will show the milestone column in the spreadsheet of this project.
  • Milestone Title If you want to get the issues of a specific milestone, you need to write its name in this column. Empty column means showing all issues ( with or without milestone ). Any means showing all issues with any milestone. None means showing all issues without any milestone.

How to use

Now you can use this package easily. Just see the following example:

const gitSheet: GitSheet = new GitSheet({
  gitBaseURL: 'your basic GIT URL based on you git application',
  gitAccessToken: 'your personal git access token',
  googleClientEmail: 'your google client email',
  googlePrivateKey: 'your google private key',
});

gitSheet.start({
  projectInformationSheetID: 'your project information spreadsheet ID',
  cronJonTime: 'the cron format time', // the process will be repeat based on this time
});