{"id":16577725,"url":"https://github.com/alexwilson/enable-github-automerge-action","last_synced_at":"2025-10-25T12:46:06.208Z","repository":{"id":36986095,"uuid":"336912371","full_name":"alexwilson/enable-github-automerge-action","owner":"alexwilson","description":"Speed up your workflows by automatically enabling Auto-Merge in your Github pull-requests, so you can release when ready.","archived":false,"fork":false,"pushed_at":"2024-10-30T01:15:09.000Z","size":1381,"stargazers_count":22,"open_issues_count":6,"forks_count":5,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-30T03:53:33.566Z","etag":null,"topics":["auto-merge","automerge","ci-cd","continuous-delivery","github","github-actions"],"latest_commit_sha":null,"homepage":"https://github.com/marketplace/actions/enable-github-automerge","language":"TypeScript","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/alexwilson.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2021-02-07T23:25:51.000Z","updated_at":"2024-10-30T01:15:13.000Z","dependencies_parsed_at":"2024-01-01T02:31:03.240Z","dependency_job_id":"a34b6cc2-1d92-454a-8578-56034306743c","html_url":"https://github.com/alexwilson/enable-github-automerge-action","commit_stats":{"total_commits":487,"total_committers":8,"mean_commits":60.875,"dds":0.06981519507186862,"last_synced_commit":"2f2b8be19ed1dc413311b0a08ab237e6cc398c8d"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexwilson%2Fenable-github-automerge-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexwilson%2Fenable-github-automerge-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexwilson%2Fenable-github-automerge-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexwilson%2Fenable-github-automerge-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexwilson","download_url":"https://codeload.github.com/alexwilson/enable-github-automerge-action/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248045231,"owners_count":21038553,"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":["auto-merge","automerge","ci-cd","continuous-delivery","github","github-actions"],"created_at":"2024-10-11T22:12:02.856Z","updated_at":"2025-10-25T12:46:01.169Z","avatar_url":"https://github.com/alexwilson.png","language":"TypeScript","readme":"# Enable Github Auto-Merge Action\n\n\u003e Speed up your workflows by automatically enabling Auto-Merge in your Github pull-requests, so you can release when ready.\n\n[![Public workflows that use this action](https://img.shields.io/endpoint?url=https%3A%2F%2Fapi-git-master.endbug.vercel.app%2Fapi%2Fgithub-actions%2Fused-by%3Faction%3Dalexwilson%2Fenable-github-automerge-action%26badge%3Dtrue)](https://github.com/search?o=desc\u0026q=alexwilson%2Fenable-github-automerge-action+path%3A.github%2Fworkflows+language%3AYAML\u0026s=\u0026type=Code)\n[![CI status](https://github.com/alexwilson/enable-github-automerge-action/workflows/Test/badge.svg)](https://github.com/alexwilson/enable-github-automerge-action/actions?query=workflow%Test)\n\n\nName: `alexwilson/enable-github-automerge-action`\n\n## 1) What is this?\n\nTo speed up some of your workflows, this action allows you to automatically enable [Auto-Merge](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/automatically-merging-a-pull-request) in your Github pull-requests.\n\nWhen enabled, auto-merge will merge pull-requests automatically _as soon as all requirements are met_ (i.e. approvals, passing tests).\n\n_You can use this, for example, to automatically merge Dependabot pull-requests_.\n\nThis action pairs well with [`hmarr/auto-approve-action`](https://github.com/hmarr/auto-approve-action).\n\n## 2) Usage\n\nAdd as a step inside a GitHub workflow, e.g. `.github/workflows/auto-merge.yml`.  [You can see an example of this in this repository](./.github/workflows/auto-merge-dependabot.yml).\n\n\u003e ⚠️  GitHub have [recently improved the security model of actions](https://github.blog/changelog/2021-02-19-github-actions-workflows-triggered-by-dependabot-prs-will-run-with-read-only-permissions/) reducing the risk of unknown code accessing secrets, so we recommend running this in an isolated workflow within the `pull_request_target` scope, on a trusted event (e.g. `labeled`).\n\n```yaml\nname: Auto-Merge\non:\n  pull_request_target:\n    types: [labeled]\n\njobs:\n  enable-auto-merge:\n    runs-on: ubuntu-latest\n\n    # Specifically check that dependabot (or another trusted party) created this pull-request, and that it has been labelled correctly.\n    if: github.event.pull_request.user.login == 'dependabot[bot]' \u0026\u0026 contains(github.event.pull_request.labels.*.name, 'dependencies')\n    steps:\n    - uses: alexwilson/enable-github-automerge-action@main\n      with:\n        github-token: \"${{ secrets.GITHUB_TOKEN }}\"\n```\n\n*Note*: You will probably want to add some restrictions so this doesn't auto-merge every PR: these are handled fairly well by GitHub Workflow syntax, [you can read more about this here](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstepsif).\n\n### 2.1) Additional Options\n\n```yaml\n    - uses: alexwilson/enable-github-automerge-action@1.0.0\n      with:\n        github-token: \"${{ secrets.GITHUB_TOKEN }}\"\n        merge-method: \"SQUASH\"\n```\n\n- **github-token**: The Github Token to use for this action.  By default this variable is set to run as `github-actions`, however you can replace this with another user/actor's Github Token (make sure it has, _at minimum_, `repo` scope).\n- **merge-method**: Override the merge method.  By default this action attempts to select your repository's default merge method, and falls back to merge.  One of `MERGE`, `SQUASH` or `REBASE`.  [Read more here](https://docs.github.com/en/graphql/reference/enums#pullrequestmergemethod).\n\n## 3) Developing Locally\n\nGithub Action developer-experience isn't fantastic, so for now we mimic the Github Action environment in `./src/local.ts`.\n\nThis file sets environment variables locally to enable action inputs, and points to a sample pull-request webhook event in `./stub/example-pull-request.json`.\n\n1. Make sure you're running a recent version of Node (the correct version will always be in `.nvmrc` and `action.yml`)\n2. Set `GITHUB_TOKEN` locally.  (You can do this via `$ export GITHUB_TOKEN=blah`)\n3. Optionally(!) set `MERGE_METHOD` locally.  (You can do this via `$ export MERGE_METHOD=MERGE`)\n4. Run with `npm run local`.\n5. **Important**: Avoid committing anything to `dist/*` — this is automatically regenerated and manually adjusting this will make rebasing harder!\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexwilson%2Fenable-github-automerge-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexwilson%2Fenable-github-automerge-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexwilson%2Fenable-github-automerge-action/lists"}