{"id":20020609,"url":"https://github.com/sleavely/git-ci-utils","last_synced_at":"2026-05-07T00:36:37.749Z","repository":{"id":143508609,"uuid":"604580662","full_name":"Sleavely/git-ci-utils","owner":"Sleavely","description":"Utilities for interacting with Git in CI environments","archived":false,"fork":false,"pushed_at":"2023-03-02T08:20:49.000Z","size":54,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-29T23:02:22.428Z","etag":null,"topics":["git","nodejs","pull-requests"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/Sleavely.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-21T11:10:19.000Z","updated_at":"2023-03-04T03:32:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"93e93627-9f4c-4d6e-8968-b2e3c9ea96ca","html_url":"https://github.com/Sleavely/git-ci-utils","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/Sleavely/git-ci-utils","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sleavely%2Fgit-ci-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sleavely%2Fgit-ci-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sleavely%2Fgit-ci-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sleavely%2Fgit-ci-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sleavely","download_url":"https://codeload.github.com/Sleavely/git-ci-utils/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sleavely%2Fgit-ci-utils/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262774309,"owners_count":23362285,"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":["git","nodejs","pull-requests"],"created_at":"2024-11-13T08:33:14.233Z","updated_at":"2026-05-07T00:36:37.720Z","avatar_url":"https://github.com/Sleavely.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# git-ci-utils\n\nUtilities for interacting with Git in CI environments\n\n[ ![npm version](https://img.shields.io/npm/v/git-ci-utils.svg?style=flat) ](https://npmjs.org/package/git-ci-utils \"View this project on npm\") [ ![Issues](https://img.shields.io/github/issues/Sleavely/git-ci-utils.svg) ](https://github.com/Sleavely/git-ci-utils/issues)\n\n## Usage\n\nTo annotate all the files that have changed, compared to the branch we aim to merge with.\n\n```js\nconst ci = require('git-ci-utils')\nconst pr = ci.getPullrequest()\nconst report = pr.createReport()\nconst changedFiles = await ci.getChangedFiles()\n\nfor (const filePath of changedFiles) {\n  report.addLine({filePath, line: 11, title: 'Hello', message: 'This is fun' })\n}\nreport.send({ success: true, title: 'My Fancy Report' })\n```\n\nDepending on your provider, it may end up looking something like:\n\n![](https://i.imgur.com/Hu7pTAl.png)\n\n![](https://i.imgur.com/MLG7L6v.png)\n\n### Supported PR providers\n\n* Bitbucket\n* Github\n* localhost\n\n### Notes on localhost usage\n\nBecause many of the environment variables that exist in a CI environment are going to be missing for you locally, _git-ci-utils_ makes some assumptions about your project.\n\nBecause there is no environment variable that tells git-ci-utils where you intend to merge your work later, it assumes the target branch is either `main` or `master`. It determines which to use by looking at your list of remote branches on `origin`.\n\n### Environment variables\n\n_git-ci-utils_ makes use of many environment variables for the PR providers, but there are a few you may want to tweak in some scenarios:\n\n#### `DEBUG`\n\nSet to `*` or `git-ci-utils:*` to enable verbose output for debugging. _git-ci-utils_ uses [_debug_](https://github.com/debug-js/debug)\n\n#### `MAX_EXEC_BUFFER_MB`\n\nThe size of the buffer that holds output from shell commands. Normally you shouldn't have to change this value. The default is `10`.\n\n## Similar projects and inspiration\n\nBitbucket-specific\n\n* [Code Insights | Bitbucket Cloud](https://support.atlassian.com/bitbucket-cloud/docs/code-insights/)\n* [bpr-npm-audit](https://github.com/saibotsivad/bpr-npm-audit)\n* [eslint-formatter-bitbucket-reports](https://github.com/spartez/eslint-formatter-bitbucket-reports)\n\nGithub-specific\n\n* [Workflow commands for Github Actions](https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#example-creating-an-annotation-for-an-error)\n* [eslint-annotate-action](https://github.com/ataylorme/eslint-annotate-action)\n\n## License\n\nThis project uses the MIT license. See [LICENSE.md](./LICENSE.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsleavely%2Fgit-ci-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsleavely%2Fgit-ci-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsleavely%2Fgit-ci-utils/lists"}