{"id":13725753,"url":"https://github.com/SvanBoxel/delete-merged-branch","last_synced_at":"2025-05-07T20:33:36.543Z","repository":{"id":33041452,"uuid":"141143250","full_name":"SvanBoxel/delete-merged-branch","owner":"SvanBoxel","description":"No more manually deleting merged branches, this lovely app does it for you.","archived":false,"fork":false,"pushed_at":"2024-02-16T07:13:09.000Z","size":2684,"stargazers_count":323,"open_issues_count":28,"forks_count":56,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-04-24T16:32:26.089Z","etag":null,"topics":["probot"],"latest_commit_sha":null,"homepage":"https://github.com/apps/delete-merged-branch/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SvanBoxel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2018-07-16T13:35:13.000Z","updated_at":"2025-04-11T15:22:03.000Z","dependencies_parsed_at":"2024-09-26T08:01:47.284Z","dependency_job_id":null,"html_url":"https://github.com/SvanBoxel/delete-merged-branch","commit_stats":{"total_commits":235,"total_committers":13,"mean_commits":"18.076923076923077","dds":"0.44680851063829785","last_synced_commit":"2b5b058e3db41a3328fd9a6a58fd4c2545a14353"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SvanBoxel%2Fdelete-merged-branch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SvanBoxel%2Fdelete-merged-branch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SvanBoxel%2Fdelete-merged-branch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SvanBoxel%2Fdelete-merged-branch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SvanBoxel","download_url":"https://codeload.github.com/SvanBoxel/delete-merged-branch/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251801181,"owners_count":21645968,"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":["probot"],"created_at":"2024-08-03T01:02:33.848Z","updated_at":"2025-05-07T20:33:35.558Z","avatar_url":"https://github.com/SvanBoxel.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"![delete-merged-branch](https://socialify.git.ci/SvanBoxel/delete-merged-branch/image?description=1\u0026font=KoHo\u0026forks=1\u0026issues=1\u0026language=1\u0026pattern=Signal\u0026pulls=1\u0026stargazers=1\u0026theme=Dark)\n\n# Delete merged branch\n\n[![Build Status](https://github.com/SvanBoxel/delete-merged-branch/workflows/Test%20bot%20e2e/badge.svg)](https://github.com/SvanBoxel/delete-merged-branch/actions)\n_Want to see more badges? [Click here](#badges)!_\n\n\n_Want to run this app with [GitHub Actions](https://github.com/features/actions)? [Click here](#running-in-github-actions)_\n\nA GitHub app built with [Probot](https://github.com/probot/probot) that automatically deletes a branch after it's merged. That's it, enjoy! \n\n### 🔔 Wait, do you really need this? 🔔\nYou may not need this app as GitHub [recently added this feature](https://github.blog/changelog/2019-07-31-automatically-delete-head-branches-of-pull-requests/) natively to their platform. It allows you to automatically delete the head branch after a merge. If you need more advanced controls and configuration settings, this app is still well suited for the job. \n\n\n## Running it locally\n1. First, follow [these instructions](https://probot.github.io/docs/development/#configure-a-github-app) for making your own GitHub app.\n    1. Give your app the following permissions:\n          - Repository contents: Read \u0026 Write.\n          - Pull requests: Read\n    2. And Subscribe to the following events\n          - Pull Request\n\n2. Then, clone the repo:\n```sh\ngit clone git@github.com:SvanBoxel/delete-merged-branch.git\n```\n\n3. Copy `.env.example` to `.env` and set the right environment variables as [here](https://probot.github.io/docs/configuration/)\n\n4. Now, install app dependencies and run it:\n\n```sh\n# Install dependencies\nnpm install\n\n# Run the bot\nnpm start\n```\n\n## How it works\nThis GitHub app listens to the `pull_request.closed` webhook. If a pull request is closed and the connected branch is merged, it will delete the branch.\n\n## Configuration\nThe optional app configuration YAML file should be saved as `.github/delete-merged-branch-config.yml`. At the moment it supports the following options:\n\n- `exclude` _(array)_ - list of branches that should not be automatically deleted after a merge. Wildcards supported.\n- `delete_closed_pr` _(bool)_ whether or not a branch should be deleted if PR is closed without merging\n\nExample `.github/delete-merged-branch-config.yml`:\n\n```\nexclude: \n  - development\n  - qa\n  - feature-*\ndelete_closed_pr: true\n```\n\n## Release process\nCI (GitHub Actions) is in charge of releasing new versions of the GitHub App to [Google Cloud Platform](https://cloud.google.com). On every new commit to master we run [semantic-release](https://github.com/semantic-release/semantic-release) to determine whether the major/minor/patch version should be incremented. If so, we update the version running in production.\n\n## Running in GitHub actions\nThis app is compatible with [GitHub Actions](https://github.com/features/actions). You need to create a workflow that is triggered on the `pull_request` event for this. Then, you use this repo for the action. (`SvanBoxel/delete-merged-branch@master`). Don't forget to check the `GITHUB_TOKEN` secret. That's it.\n\n```yml\nname: delete branch on close pr\non: \n  pull_request:\n    types: [closed]\n  \njobs:\n  delete-branch:\n    runs-on: ubuntu-latest\n    steps:\n      - name: delete branch\n        uses: SvanBoxel/delete-merged-branch@main\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n```\n\n## Contributing\n\nIf you have suggestions for how this GitHub app could be improved, or want to report a bug, open an issue! We'd love all and any contributions.\n\nFor more, check out the [Contributing Guide](CONTRIBUTING.md).\n\n## License\n\n[ISC](LICENSE) © 2018 Sebass van Boxel \u003chello@svboxel.com\u003e\n\n## Badges\n[![Build Status](https://github.com/SvanBoxel/delete-merged-branch/workflows/Test%20bot%20e2e/badge.svg)](https://github.com/SvanBoxel/delete-merged-branch/actions)\n[![codecov](https://codecov.io/gh/SvanBoxel/delete-merged-branch/branch/master/graph/badge.svg)](https://codecov.io/gh/SvanBoxel/delete-merged-branch)\n[![Greenkeeper badge](https://badges.greenkeeper.io/SvanBoxel/delete-merged-branch.svg?token=f5b0c3f23f4ab216a26c3c3559453a514b321c54b14aed881e543a5969eeca62\u0026ts=1531752685299)](https://greenkeeper.io/)\n[![Project maintainability](https://sonarcloud.io/api/project_badges/measure?project=SvanBoxel_delete-merged-branch\u0026metric=sqale_rating)](https://sonarcloud.io/dashboard?id=SvanBoxel_delete-merged-branch)\n[![npm version](https://badge.fury.io/js/delete-merged-branch.svg)](https://www.npmjs.com/package/delete-merged-branch)\n[![Total alerts](https://img.shields.io/lgtm/alerts/g/SvanBoxel/delete-merged-branch.svg?logo=lgtm\u0026logoWidth=18)](https://lgtm.com/projects/g/SvanBoxel/delete-merged-branch/alerts/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSvanBoxel%2Fdelete-merged-branch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSvanBoxel%2Fdelete-merged-branch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSvanBoxel%2Fdelete-merged-branch/lists"}