{"id":17035938,"url":"https://github.com/mkoryak/magic-merge-plz","last_synced_at":"2026-05-11T07:48:35.898Z","repository":{"id":148605517,"uuid":"92858193","full_name":"mkoryak/magic-merge-plz","owner":"mkoryak","description":"automate github branch merging","archived":false,"fork":false,"pushed_at":"2017-02-03T21:12:49.000Z","size":136,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-22T22:42:37.947Z","etag":null,"topics":["github","github-bot","nodejs"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":false,"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/mkoryak.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-05-30T17:23:15.000Z","updated_at":"2017-11-07T01:36:22.000Z","dependencies_parsed_at":"2023-05-20T16:45:25.821Z","dependency_job_id":null,"html_url":"https://github.com/mkoryak/magic-merge-plz","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/mkoryak/magic-merge-plz","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkoryak%2Fmagic-merge-plz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkoryak%2Fmagic-merge-plz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkoryak%2Fmagic-merge-plz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkoryak%2Fmagic-merge-plz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mkoryak","download_url":"https://codeload.github.com/mkoryak/magic-merge-plz/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkoryak%2Fmagic-merge-plz/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262056494,"owners_count":23251683,"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":["github","github-bot","nodejs"],"created_at":"2024-10-14T08:48:39.145Z","updated_at":"2026-05-11T07:48:30.858Z","avatar_url":"https://github.com/mkoryak.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# magic-merge-plz\nautomate github branch merging.\n\nThis thing checks your github repos for PRs which are APPROVED and have a magic label added to them.\nIf it finds such PRs it will merge them and delete the branch.\n\nIt is useful if you have things that run which prevent merging until they complete, and people have to\nconstantly go back and check their status before doing the merge.\n\n# Other things it does\n\n- if a PR has any \"changes requested\" things, it will thumb down the PR\n- if a PR has no \"changes requested\" and at least one approval, it will thumb up the PR\n- if the magic label is added to a PR it will add itself as an assignee, and remove itself if label is removed\n- there is an option to have it mark stale PRs with \"Stale PR\" label.\n\n# Requirements\nnode 6+\n\n# Installing\n\n`npm install magic-merge-plz`\n\n# Using\n\nThe export of this thing is a class named MagicMerge\n\nthe constructor takes a settings object:\n\n```js\n{\n    settings.org         string, org name - catalant\n    settings.repos       array, array of repo names in org to check\n    settings.label       string, magic label name, defaults to 'a magic merge plz'\n    settings.user        string, username of user on whose behalf magic-merge will act\n    settings.auth        object, auth object with {password} or {token}\n    settings.stalePrDays number, number of days a pr should stay open to get an emitted event about it\n}\n```\n\nthe instance of MagicMerge is an EventEmitter, it emits the following events:\n\n- debug (args: message)\n- merged (args: pr, repo)\n- stale (args: pr, repo)\n- warning (args: message)\n- rate-limit (args: remainingRequests, minutesUntilReset)\n\n# Example\n\n```js\nimport MagicMerge from 'magic-merge-plz';\n\nconst magic = new MagicMerge({\n    org: 'catalant',\n    repos: ['magic-merge-plz', 'hn-webpack', 'hn-nerd-experience', 'hn-enterprise-portal', 'hn-marketing-sales'],\n    label: 'a magic merge plz',\n    stalePrDays: 1,\n    username: 'catman',\n    auth: require('./auth.json')\n});\n\n// start checking the repos for PRs with the magic merge label which are approved\nmagic.start().on('debug', (msg) =\u003e {\n    console.log('magic-merge:', msg);\n}).on('warning', (msg) =\u003e {\n    console.log('magic-merge WARN:', msg);\n}).on('merged', (pr, repo) =\u003e {\n    console.log('MERGED!', repo, pr.number);\n}).on('stale', (pr, repo) =\u003e {\n    // you will see this if a pr has been open for longer than `stalePrDays`\n    console.log('stale pr', pr, repo);\n}).on('rate-limit', (remainingRequests, minutesUntilReset) =\u003e {\n    console.log(`remaining requests: [${remainingRequests}] rate reset in minutes: [${minutesUntilReset.toFixed(2)}]`);\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmkoryak%2Fmagic-merge-plz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmkoryak%2Fmagic-merge-plz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmkoryak%2Fmagic-merge-plz/lists"}