{"id":13432953,"url":"https://github.com/hmarr/auto-approve-action","last_synced_at":"2025-04-08T08:14:57.470Z","repository":{"id":38361498,"uuid":"154219663","full_name":"hmarr/auto-approve-action","owner":"hmarr","description":"👍 GitHub Action for automatically approving GitHub pull requests","archived":false,"fork":false,"pushed_at":"2024-04-04T17:12:49.000Z","size":1400,"stargazers_count":431,"open_issues_count":9,"forks_count":85,"subscribers_count":5,"default_branch":"v4","last_synced_at":"2025-04-01T05:34:21.300Z","etag":null,"topics":["actions","github-actions"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/hmarr.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":"2018-10-22T21:27:58.000Z","updated_at":"2025-03-17T14:34:56.000Z","dependencies_parsed_at":"2024-06-18T10:58:56.646Z","dependency_job_id":null,"html_url":"https://github.com/hmarr/auto-approve-action","commit_stats":{"total_commits":181,"total_committers":17,"mean_commits":"10.647058823529411","dds":0.4530386740331491,"last_synced_commit":"44888193675f29a83e04faf4002fa8c0b537b1e4"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmarr%2Fauto-approve-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmarr%2Fauto-approve-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmarr%2Fauto-approve-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmarr%2Fauto-approve-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hmarr","download_url":"https://codeload.github.com/hmarr/auto-approve-action/tar.gz/refs/heads/v4","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247801172,"owners_count":20998339,"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":["actions","github-actions"],"created_at":"2024-07-31T02:01:18.951Z","updated_at":"2025-04-08T08:14:57.449Z","avatar_url":"https://github.com/hmarr.png","language":"TypeScript","funding_links":[],"categories":["TypeScript","Community Resources"],"sub_categories":["Pull Requests"],"readme":"# Auto Approve GitHub Action\n\n[![CI](https://github.com/hmarr/auto-approve-action/actions/workflows/ci.yml/badge.svg?event=push)](https://github.com/hmarr/auto-approve-action/actions/workflows/ci.yml)\n\n**Name:** `hmarr/auto-approve-action`\n\nAutomatically approve GitHub pull requests.\n\n**Important:** use v4 or later, as earlier versions use deprecated versions of node. If you're on an old version of GHES (with an old version of the node interpreter) you may need to use an easier version until you can upgrade.\n\n## Usage instructions\n\nCreate a workflow file (e.g. `.github/workflows/auto-approve.yml`) that contains a step that `uses: hmarr/auto-approve-action@v4`. Here's an example workflow file:\n\n```yaml\nname: Auto approve\non: pull_request_target\n\njobs:\n  build:\n    runs-on: ubuntu-latest\n    permissions:\n      pull-requests: write\n    steps:\n      - uses: hmarr/auto-approve-action@v4\n```\n\nCombine with an `if` clause to only auto-approve certain users. For example, to auto-approve [Dependabot][dependabot] pull requests, use:\n\n```yaml\nname: Auto approve\n\non: pull_request_target\n\njobs:\n  auto-approve:\n    runs-on: ubuntu-latest\n    permissions:\n      pull-requests: write\n    if: github.actor == 'dependabot[bot]'\n    steps:\n      - uses: hmarr/auto-approve-action@v4\n```\n\nIf you want to use this action from a workflow file that doesn't run on the `pull_request` or `pull_request_target` events, use the `pull-request-number` input:\n\n```yaml\nname: Auto approve\n\non:\n  workflow_dispatch:\n    inputs: \n      pullRequestNumber:\n        description: Pull request number to auto-approve\n        required: false\n\njobs:\n  auto-approve:\n    runs-on: ubuntu-latest\n    permissions:\n      pull-requests: write\n    steps:\n    - uses: hmarr/auto-approve-action@v4\n      with:\n        pull-request-number: ${{ github.event.inputs.pullRequestNumber }}\n```\n\nOptionally, you can provide a message for the review:\n\n```yaml\nname: Auto approve\n\non: pull_request_target\n\njobs:\n  auto-approve:\n    runs-on: ubuntu-latest\n    permissions:\n      pull-requests: write\n    if: github.actor == 'dependabot[bot]'\n    steps:\n      - uses: hmarr/auto-approve-action@v4\n        with:\n          review-message: \"Auto approved automated PR\"\n```\n\n### Approving on behalf of a different user\n\nBy default, this will use the [automatic GitHub token](https://docs.github.com/en/actions/security-guides/automatic-token-authentication) that's provided to the workflow. This means the approval will come from the \"github-actions\" bot user. Make sure you enable the `pull-requests: write` permission in your workflow.\n\nTo approve the pull request as a different user, pass a GitHub Personal Access Token into the `github-token` input. In order to approve the pull request, the token needs the `repo` scope enabled.\n\n```yaml\nname: Auto approve\n\non: pull_request_target\n\njobs:\n  auto-approve:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: hmarr/auto-approve-action@v4\n        with:\n          github-token: ${{ secrets.SOME_USERS_PAT }}\n```\n\n### Approving Dependabot pull requests\n\nWhen a workflow is run in response to a Dependabot pull request using the `pull_request` event, the workflow won't have access to secrets. If you're trying to use a Personal Access Token (as above) but getting an error on Dependabot pull requests, this is probably why.\n\nFortunately the fix is simple: use the `pull_request_target` event instead of `pull_request`. This runs the workflow in the context of the base branch of the pull request, which does have access to secrets.\n\n## Why?\n\nGitHub lets you prevent merges of unapproved pull requests. However, it's occasionally useful to selectively circumvent this restriction - for instance, some people want Dependabot's automated pull requests to not require approval.\n\n[dependabot]: https://github.com/marketplace/dependabot\n\n## Code owners\n\nIf you're using a [CODEOWNERS file](https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners), you'll need to give this action a personal access token for a user listed as a code owner. Rather than using a real user's personal access token, you're probably better off creating a dedicated bot user, and adding it to a team which you assign as the code owner. That way you can restrict the bot user's permissions as much as possible, and your workflow won't break when people leave the team.\n\n## Development and release process\n\nEach major version corresponds to a branch (e.g. `v3`, `v4`). The latest major version (`v4` at the time of writing) is the repository's default branch. Releases are tagged with semver-style version numbers (e.g. `v1.2.3`).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhmarr%2Fauto-approve-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhmarr%2Fauto-approve-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhmarr%2Fauto-approve-action/lists"}