Giter Club home page Giter Club logo

import's Introduction

import

data from .all-contributorsrc across public GitHub repositories.

This repository is a self-updating data provider of endorsements that are gather automatically across public GitHub repositories.

You can find the latest data at data/endorsements.csv

Usage

Subscribe to updates

In order to be notified about updates, install the all-contributors-import app on a repository where you want to handle the update.

To see an example of how to handle updates, see .github/workflows/subscribe.yml.

We only pass the startSeq and endSeq as part of the update because repository dispatch payloads are limited in size. But you can download the latest version of data/endorsements.csv at https://raw.githubusercontent.com/all-contributors/import/main/data/endorsements.csv and then filter out based on the provided sequence numbers.

CLI

In order to run the import script, you need to define a GITHUB_TOKEN environment variable to a personal access token with the public_repo scope (create one).

GITHUB_TOKEN=... npx all-contributors-import

If you would like to write the unformated logs to a separate file you can run this command on Linux or macOS

GITHUB_TOKEN=... npx all-contributors-import | tee .results/import.jsonl | npx pino-pretty

How it works

This repository consists of

  1. The import script (entry point: /bin/cli.js)
  2. The imported data: /data
  3. A workflow to run the import each day: .github/workflows/update.yml
  4. A script to notify everyone interested about an update: scripts/notify.js

The import script

  1. Find .all-contributorsrc files
    1. In public GitHub repositories using GET /search/code API
    2. Based on existing data in data/endorsements.csv
    3. Update data/endorsements.csv with all new files and latest update meta data
  2. Retrieve commits for each file using GraphQL (as it's easier to retrieve associated pull requests and author user information)
    1. If it's a new file, retrieve all commits
    2. If existing endorsement have been sourced before, retrieve all commits after that
  3. Calculate the difference of the .all-contributorsrc file for each version and store separate endorsements in .results/endorsements.csv

The update notification

The scripts/notify.js script is called as part of the daily update workflow. The script is called with the credentials of the all-contributors-import app. The script iterates through all repositories the app is installed in and creates a repository dispatch event with event_type set to all-contributors-import:update and client_payload set to { startSeq, endSeq }

Sponsors

OpenSauced logo

OpenSauced provides insights into open source projects by using data science in git commits.

License

ISC

import's People

Contributors

all-contributors-import[bot] avatar gr2m avatar bdougie avatar parkerbxyz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.