{"id":15934443,"url":"https://github.com/tobiasbueschel/git-is-branch-protected","last_synced_at":"2026-04-29T21:32:36.091Z","repository":{"id":98227567,"uuid":"183895325","full_name":"tobiasbueschel/git-is-branch-protected","owner":"tobiasbueschel","description":"🔒Checks whether current Git branch is protected","archived":false,"fork":false,"pushed_at":"2020-04-30T17:56:37.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-24T23:44:34.379Z","etag":null,"topics":["bitbucket","branch","conventional","git","git-flow","github","gitlab"],"latest_commit_sha":null,"homepage":"","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/tobiasbueschel.png","metadata":{"files":{"readme":"readme.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"license","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":"2019-04-28T10:47:32.000Z","updated_at":"2020-04-30T17:56:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"a4973046-d297-4b66-bebd-5388851bae52","html_url":"https://github.com/tobiasbueschel/git-is-branch-protected","commit_stats":{"total_commits":5,"total_committers":3,"mean_commits":"1.6666666666666667","dds":0.6,"last_synced_commit":"c3bd31262c4dc5ccedc42b6a7d392695abdcefe8"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/tobiasbueschel/git-is-branch-protected","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobiasbueschel%2Fgit-is-branch-protected","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobiasbueschel%2Fgit-is-branch-protected/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobiasbueschel%2Fgit-is-branch-protected/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobiasbueschel%2Fgit-is-branch-protected/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tobiasbueschel","download_url":"https://codeload.github.com/tobiasbueschel/git-is-branch-protected/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobiasbueschel%2Fgit-is-branch-protected/sbom","scorecard":{"id":890797,"data":{"date":"2025-08-11","repo":{"name":"github.com/tobiasbueschel/git-is-branch-protected","commit":"c3bd31262c4dc5ccedc42b6a7d392695abdcefe8"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Code-Review","score":0,"reason":"Found 0/3 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: license:0","Info: FSF or OSI recognized license: MIT License: license:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 2 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-24T11:45:36.129Z","repository_id":98227567,"created_at":"2025-08-24T11:45:36.130Z","updated_at":"2025-08-24T11:45:36.130Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32445078,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T20:22:27.477Z","status":"ssl_error","status_checked_at":"2026-04-29T20:22:26.507Z","response_time":110,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["bitbucket","branch","conventional","git","git-flow","github","gitlab"],"created_at":"2024-10-07T03:03:06.361Z","updated_at":"2026-04-29T21:32:36.072Z","avatar_url":"https://github.com/tobiasbueschel.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# git-is-branch-protected\n\n[![Build Status](https://img.shields.io/travis/tobiasbueschel/git-is-branch-protected/master.svg?style=flat-square)](https://travis-ci.com/tobiasbueschel/git-is-branch-protected)\n[![version](https://img.shields.io/npm/v/git-is-branch-protected.svg?style=flat-square)](http://npm.im/git-is-branch-protected)\n[![downloads](https://img.shields.io/npm/dm/git-is-branch-protected.svg?style=flat-square)](http://npm-stat.com/charts.html?package=git-is-branch-protected)\n[![codecov](https://img.shields.io/codecov/c/github/tobiasbueschel/git-is-branch-protected.svg?style=flat-square)](https://codecov.io/gh/tobiasbueschel/git-is-branch-protected?branch=master)\n\n[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=flat-square)](https://github.com/semantic-release/semantic-release)\n[![MIT License](https://img.shields.io/npm/l/git-is-branch-protected.svg?style=flat-square)](http://opensource.org/licenses/MIT)\n\n\u003e Checks whether current Git branch is protected\n\n## Install\n\n```\n$ npm install git-is-branch-protected\n```\n\n## Usage\n\n\u003c!-- prettier-ignore-start --\u003e\n```js\nconst gitIsBranchProtected = require('git-is-branch-protected')\n\n(async () =\u003e {\n\t// currently on \"master\" branch\n\tawait gitIsBranchProtected()\n\t//=\u003e true\n\n\tawait gitIsBranchProtected('master')\n\t//=\u003e true\n\n\tawait gitIsBranchProtected('develop')\n\t//=\u003e true\n\n\tawait gitIsBranchProtected('feat/add-something')\n\t//=\u003e false\n\n\tawait gitIsBranchProtected('develop', ['master'])\n\t//=\u003e false\n\n\tawait gitIsBranchProtected('develop', ['master, develop'])\n\t//=\u003e true\n\n\tawait gitIsBranchProtected('DEVELOP', ['master, develop'], { caseSensitive: true })\n\t//=\u003e false\n})()\n```\n\u003c!-- prettier-ignore-end --\u003e\n\n## API\n\n### gitIsBranchProtected([currentBranch], [protectedBranches], [options])\n\nReturns `true` or `false` indicating whether a branch is _protected_.\n\n#### currentBranch\n\nType: `string`\n\nThe name of the current branch. Defaults to check the actual branch name of the current directory.\n\n#### protectedBranches\n\nType: `Array`\u003cbr\u003e\nDefault: `['master', 'develop']`\n\nWhich branches you would like to protect. By default, `master` and `develop` are protected.\n\n#### options\n\nType: `Object`\n\n##### caseSensitive\n\nType: `boolean`\u003cbr\u003e\nDefault: `false`\n\nWhether the check should be performed case sensitive.\n\n## Related\n\n- [git-is-branch-protected-cli](https://github.com/tobiasbueschel/git-is-branch-protected-cli) - CLI for this project.\n- [git-push-pr](https://github.com/tobiasbueschel/git-push-pr) - Push and open pull request in your default browser.\n\n## License\n\nMIT © [Tobias Büschel](https://github.com/tobiasbueschel)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftobiasbueschel%2Fgit-is-branch-protected","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftobiasbueschel%2Fgit-is-branch-protected","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftobiasbueschel%2Fgit-is-branch-protected/lists"}