{"id":13501286,"url":"https://github.com/benjefferies/branch-protection-bot","last_synced_at":"2026-04-03T17:02:08.088Z","repository":{"id":38006843,"uuid":"221226834","full_name":"benjefferies/branch-protection-bot","owner":"benjefferies","description":"A bot tool to disable and re-enable \"Include administrators\" option in branch protection","archived":false,"fork":false,"pushed_at":"2024-05-21T06:59:57.000Z","size":198,"stargazers_count":72,"open_issues_count":8,"forks_count":18,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-04T08:48:04.185Z","etag":null,"topics":["actions","bot","branch","branch-protection","ci","github","github-actions","protection"],"latest_commit_sha":null,"homepage":"","language":"Python","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/benjefferies.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"benjefferies"}},"created_at":"2019-11-12T13:39:56.000Z","updated_at":"2024-01-16T17:26:51.000Z","dependencies_parsed_at":"2023-11-29T16:48:05.500Z","dependency_job_id":"31f98971-a46a-4c8d-affe-41a3ec7ac50a","html_url":"https://github.com/benjefferies/branch-protection-bot","commit_stats":{"total_commits":85,"total_committers":3,"mean_commits":"28.333333333333332","dds":0.3058823529411765,"last_synced_commit":"b6a1ef57a47860aa483bf6048c1e888018a15f9c"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/benjefferies/branch-protection-bot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benjefferies%2Fbranch-protection-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benjefferies%2Fbranch-protection-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benjefferies%2Fbranch-protection-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benjefferies%2Fbranch-protection-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/benjefferies","download_url":"https://codeload.github.com/benjefferies/branch-protection-bot/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benjefferies%2Fbranch-protection-bot/sbom","scorecard":{"id":232931,"data":{"date":"2025-08-11","repo":{"name":"github.com/benjefferies/branch-protection-bot","commit":"958128d33ada137a4c6012f838fc7c914c999190"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.8,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/26 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":"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":10,"reason":"no dangerous workflow patterns detected","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":"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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: topLevel permissions set to 'write-all': .github/workflows/python.yml:4"],"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":"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":"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":"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":"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":"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":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"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":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/benjefferies/branch-protection-bot/python.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/benjefferies/branch-protection-bot/python.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/benjefferies/branch-protection-bot/release.yml/master?enable=pin","Warn: containerImage not pinned by hash: Dockerfile:1","Warn: containerImage not pinned by hash: Dockerfile:6","Warn: containerImage not pinned by hash: Dockerfile:19","Warn: pipCommand not pinned by hash: Dockerfile:8-11","Warn: pipCommand not pinned by hash: .github/workflows/python.yml:23","Info:   0 out of   3 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 pipCommand dependencies pinned","Info:   0 out of   3 containerImage dependencies pinned"],"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":"Vulnerabilities","score":0,"reason":"10 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2024-230 / GHSA-248v-346w-9cwc","Warn: Project is vulnerable to: GHSA-3ww4-gg4f-jr7f","Warn: Project is vulnerable to: PYSEC-2024-225 / GHSA-6vqw-3v5j-54x4","Warn: Project is vulnerable to: GHSA-9v9h-cgj8-h64p","Warn: Project is vulnerable to: GHSA-h4gh-qq45-vh27","Warn: Project is vulnerable to: PYSEC-2024-60 / GHSA-jjg7-2v4v-x38h","Warn: Project is vulnerable to: GHSA-9hjg-9r4m-mvj7","Warn: Project is vulnerable to: GHSA-9wx4-h78v-vm56","Warn: Project is vulnerable to: GHSA-34jh-p97f-mpxf","Warn: Project is vulnerable to: GHSA-pq67-6m6q-mj2v"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 6 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-17T05:09:07.175Z","repository_id":38006843,"created_at":"2025-08-17T05:09:07.181Z","updated_at":"2025-08-17T05:09:07.181Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31364588,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-03T15:19:21.178Z","status":"ssl_error","status_checked_at":"2026-04-03T15:19:20.670Z","response_time":107,"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":["actions","bot","branch","branch-protection","ci","github","github-actions","protection"],"created_at":"2024-07-31T22:01:31.628Z","updated_at":"2026-04-03T17:02:08.049Z","avatar_url":"https://github.com/benjefferies.png","language":"Python","funding_links":["https://github.com/sponsors/benjefferies"],"categories":["Python","Community Resources"],"sub_categories":["Utility"],"readme":"# Branch Protection Bot\nA bot tool to temporarily disable and re-enable `Do not allow bypassing the above settings` option in branch protection\n\nGithub doesn't have a way to give a Bot access to override the branch protection, specifically if you [Do not allow bypassing the above settings](https://github.com/isaacs/github/issues/1390).\nThe only possible solution is to disable the `Do not allow bypassing the above settings` option. This increases risk of accidental pushes to master from administrators (I've done it a few times).\nThis tool doesn't completely solve the problem of accidents happening but reduces the chances by closing the window.\n\nThe intended use of this tool is to is in a CI/CD pipeline where you require temporary access to allow a administrator Bot push to a branch.\n\n[Tutorial](https://www.turfemon.com/bump-version-protected-branch-github-actions)\n\n## How it works\n1. Your automated pipeline is kicked off\n1. Before you push to github you run this tool to disable `Do not allow bypassing the above settings`\n1. Push to the repository\n1. After you push to github you run this tool to enable `Do not allow bypassing the above settings`\n\n## Example usage\n### Docker\n```\ndocker run -e ACCESS_TOKEN=abc123 -e BRANCH=master -e REPO=branch-protection-bot -e OWNER=benjefferies benjjefferies/branch-protection-bot\n```\n\n### Github Actions\n\n```\n- name: Temporarily disable \"Do not allow bypassing the above settings\" branch protection\n  uses: benjefferies/branch-protection-bot@master\n  if: always()\n  with:\n    access_token: ${{ secrets.ACCESS_TOKEN }}\n    branch: ${{ github.event.repository.default_branch }}\n    \n- name: Deploy\n  run: |\n    mvn release:prepare -B\n    mvn release:perform -B\n   \n- name: Enable \"Do not allow bypassing the above settings\" branch protection\n  uses: benjefferies/branch-protection-bot@master\n  if: always()  # Force to always run this step to ensure \"Do not allow bypassing the above settings\" is always turned back on\n  with:\n    access_token: ${{ secrets.ACCESS_TOKEN }}\n    owner: benjefferies\n    repo: branch-protection-bot\n    branch: ${{ github.event.repository.default_branch }}\n```\n\n#### Inputs\n\n##### `access_token`\n\n**Required** Github access token. https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line. See [issue](https://github.com/benjefferies/branch-protection-bot/issues/9#issuecomment-1637223088) for required permissions\n\n##### `owner`\n\nFor example benjefferies for https://github.com/benjefferies/branch-protection-bot. If not set with repo GITHUB_REPOSITORY variable will be used\n\n##### `repo`\n\nFor example branch-protection-bot for https://github.com/benjefferies/branch-protection-bot. If not set with repo GITHUB_REPOSITORY variable will be used\n\n##### `branch`\n\nBranch name. Default `\"master\"`\n\n##### `retries`\n\nNumber of times to retry before exiting. Default `5`.\n\n##### `enforce_admins`\n\nIf you want to pin the state of `Do not allow bypassing the above settings` for a step in the workflow.\n\n#### Outputs\n\n##### `initial_status`\n\nOutput the current branch protection status of `Do not allow bypassing the above settings` prior to any change.\nYou can retrieve it from any next step in your job using: `${{ steps.disable_include_admins.outputs.initial_status }}`.\nThis would help you to restore the initial setting this way:\n\n```yaml\nsteps:\n    - name: \"Temporarily disable 'Do not allow bypassing the above settings' default branch protection\"\n    id: disable_include_admins\n    uses: benjefferies/branch-protection-bot@master\n    if: always()\n    with:\n        access_token: ${{ secrets.ACCESS_TOKEN }}\n        branch: ${{ github.event.repository.default_branch }}\n        enforce_admins: false\n    \n    - ...\n\n    - name: \"Restore 'Do not allow bypassing the above settings' default branch protection\"\n    uses: benjefferies/branch-protection-bot@master\n    if: always() # Force to always run this step to ensure \"Do not allow bypassing the above settings\" is always turned back on\n    with:\n        access_token: ${{ secrets.ACCESS_TOKEN }}\n        branch: ${{ github.event.repository.default_branch }}\n        enforce_admins: ${{ steps.disable_include_admins.outputs.initial_status }}\n```\n\n## Github repository settings\nThe Bot account must be an administrator.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenjefferies%2Fbranch-protection-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenjefferies%2Fbranch-protection-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenjefferies%2Fbranch-protection-bot/lists"}