0.0.10 • Published 3 months ago

@opentr/cuttlecat v0.0.10

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
3 months ago

CuttleCat - Collect information from GitHub

TODO: Project description, purpose, etc.

Building the project

# switch to the correct node version in .nvrmc
nvm use
# install dependencies
npm install
# build the project
npm run build

Usage

PROCESS=<process name> \
OTHER_PARAMETERS=... \
npm run start

PROCESS can be one of the following:

  • FOCUS_PROJECT_SEARCH - search for projects that match the criteria

Process FOCUS_PROJECT_SEARCH

Supports the following environment variables:

NameDescriptionDefault valuePersisted
GITHUB_TOKENGitHub API token. Token doesn't need any permissions.N/ANo
DATA_DIRECTORYData directory to read and store the output.N/ANo
RENEW_PERIOD_IN_DAYSif previous queue is completed, create the next one after RENEW_PERIOD_IN_DAYS days7No
CONCURRENCYnumber of concurrent tasks6No
PER_TASK_TIMEOUT_IN_MStimeout for each task30000No
RATE_LIMIT_STOP_PERCENTif rate limit remaining is less than RATE_LIMIT_STOP_PERCENT * rate limit (typically 1000) / 100, stop the queue.10No
INTERVAL_CAPmax number of tasks to execute in one interval4No
INTERVAL_IN_MSinterval for the cap in milliseconds20000No
RETRY_COUNTnumber of retries for each task before giving up3No
REPORT_PERIOD_IN_MSperiod to print the queue state (0 for disabled)5000No
MIN_STARSminimum number of stars50Yes
MIN_FORKSminimum number of forks50Yes
MIN_SIZE_IN_KBminimum size in KB1000Yes
MAX_INACTIVITY_DAYSmaximum number of days since last commit; ignore projects that have been inactive for longer than this90Yes
EXCLUDE_PROJECTS_CREATED_BEFOREexclude projects created before this date (format: YYYY-MM-DD)2008-01-01Yes
MIN_AGE_IN_DAYSminimum number of days since the project was created; ignore projects younger than this365Yes
SEARCH_PERIOD_IN_DAYSNumber of days to search for projects in one call5Yes
PAGE_SIZEMax number of projects to return in one call100Yes

The options marked as Yes in the Persisted column are persisted in the process state file. This means, when the process is run again for the same process file again later, it will use the values from the file. This is to continue a search process. Those values will only be used if there's a new process file created.

The options marked as No in the Persisted column will always be used from the environment variables.

The output will be written to the ./data/focus-project-search directory.

To start the process with defaults:

# store the results in a temporary directory
mkdir -p /tmp/foo/bar

GITHUB_TOKEN="$(gh auth token)" \
DATA_DIRECTORY="/tmp/foo/bar" \
PROCESS="FOCUS_PROJECT_SEARCH" \
MIN_AGE_IN_DAYS=5700 \
npm run start

Running tests

npm run test

Testing GitHub Actions workflows locally

Test publish release

  act --job=publish-release-on-npm \
  -s GITHUB_TOKEN="$(gh auth token)" \
  -s NPM_TOKEN="FAKE TOKEN" \
  --reuse=true \
  --use-gitignore=true \
  --remote-name=origin

Test publish snapshot

  act --job=publish-snapshot-on-npm \
  -s GITHUB_TOKEN="$(gh auth token)" \
  -s NPM_TOKEN="FAKE TOKEN" \
  --reuse=true \
  --use-gitignore=true \
  --remote-name=origin
0.0.10

4 months ago

0.0.9

4 months ago

0.0.8

4 months ago

0.0.7

4 months ago

0.0.6

4 months ago

0.0.5

6 months ago

0.0.4

7 months ago

0.0.3

7 months ago

0.0.2

7 months ago

0.0.1

7 months ago