{"id":19949256,"url":"https://github.com/roopakv/node-enrich-github","last_synced_at":"2025-03-01T14:26:21.431Z","repository":{"id":34300603,"uuid":"176039219","full_name":"roopakv/node-enrich-github","owner":"roopakv","description":"NPM module which makes it easy to work with enrich-github","archived":false,"fork":false,"pushed_at":"2022-02-11T17:42:07.000Z","size":250,"stargazers_count":0,"open_issues_count":10,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-12T05:44:51.336Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/roopakv.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-17T00:26:51.000Z","updated_at":"2020-02-08T05:07:48.000Z","dependencies_parsed_at":"2022-08-08T00:15:48.367Z","dependency_job_id":null,"html_url":"https://github.com/roopakv/node-enrich-github","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roopakv%2Fnode-enrich-github","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roopakv%2Fnode-enrich-github/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roopakv%2Fnode-enrich-github/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roopakv%2Fnode-enrich-github/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/roopakv","download_url":"https://codeload.github.com/roopakv/node-enrich-github/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241376796,"owners_count":19952969,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T00:44:32.711Z","updated_at":"2025-03-01T14:26:21.406Z","avatar_url":"https://github.com/roopakv.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# enrich-github\n\nNPM module which makes it easy to work with enrich-github.\n\nAt the moment, enrich github supports the following 3 APIs. Open issues on this\nrepository, for other features you would like to see.\n\n## Usage\n\nGet a token for enrich github by going to [enrichgithub.com](http://enrichgithub.com).\n\nInstantiate enrichgithub with your token and repo name\n\n```javascript\nconst EnrichGithub = require('enrich-github');\n\nconst token = process.env.ENRICH_GITHUB_TOKEN;\nconst repo = roopakv/node-enrich-github;\nconst enrichGithub = new EnrichGithub(token, repo);\n```\n\nAll methods take in an options object. The structure of each API is described\nbelow.\n\n### addCommit\n\nThis is used to add a commit on github. Currently this method supports adding\nonly one file change at a time.\n\nA commit may either be added to an existing branch, or a new branch can be\nbranched off of an existing branch.\n\n```javascript\nawait enrichGithub.addCommit({\n  file_path: 'lib/README.md',\n  file_content: 'The new contents for lib/README.md',\n  message: 'The commit message',\n  branch: 'roopakv/sample', // The branch this commit will be added to\n  create_branch: true, // Deafaults to false.\n  base: 'master' // needed only if create_branch is true\n});\n```\n\n### openPR\n\nOpens a pull request on github.\n\n```javascript\nawait enrichGithub.openPR({\n  title: 'The title of the PR',\n  branch: 'roopakv/sample',\n  body: 'The body for the PR' // optional\n  base: 'master' // defaults to master.\n})\n```\n\n### postCheck\n\nThis works with github check runs API. This API is pretty much a pass thru to\nthe github check runs api, and all that enrich github does here is\nmakes hitting this API eaiser.\n\nRead about the post checks endpoint [here](https://developer.github.com/v3/checks/runs/#create-a-check-run)\n\n```javascript\nawait enrichGithub.postCheck({\n  post_body: {\n    name: ...\n    head_sha: ...,\n    details_url: ...\n    ...\n  }\n})\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froopakv%2Fnode-enrich-github","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froopakv%2Fnode-enrich-github","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froopakv%2Fnode-enrich-github/lists"}