Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Auto-merge

on:
pull_request_review:
types: [submitted]
check_suite:
types: [completed]
workflow_run:
workflows: [CI]
types: [completed]

permissions:
contents: write
pull-requests: write

jobs:
automerge:
runs-on: ubuntu-latest
if: >-
github.event.pull_request.user.login == 'tomymaritano' ||
github.event.workflow_run.head_repository.owner.login == 'tomymaritano'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Gate owner auto-merge to PR-based workflow runs

This condition matches owner workflow_run events from normal branch pushes as well as PRs, and CI is configured to run on push to main/develop in .github/workflows/ci.yml. For those push-triggered completions there is no pull request in the event payload, but the job still calls peter-evans/enable-pull-request-automerge@v3 without a pull-request-number, so the auto-merge job will fail/no-op on regular owner pushes instead of only handling PRs. Add a guard for PR-originated workflow runs (for example checking github.event.workflow_run.event == 'pull_request' or workflow_run.pull_requests presence) before invoking the action.

Useful? React with 👍 / 👎.

steps:
- name: Enable auto-merge for owner PRs
uses: peter-evans/enable-pull-request-automerge@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
merge-method: merge

dependabot:
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]'
steps:
- name: Auto-merge dependabot PRs
uses: peter-evans/enable-pull-request-automerge@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
merge-method: merge
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pnpm lint-staged
8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,23 @@
"format": "prettier --write \"**/*.{ts,tsx,js,json,md}\" --ignore-path .gitignore",
"format:check": "prettier --check \"**/*.{ts,tsx,js,json,md}\" --ignore-path .gitignore",
"typecheck": "turbo typecheck",
"clean": "turbo clean && rm -rf node_modules .eslintcache"
"clean": "turbo clean && rm -rf node_modules .eslintcache",
"prepare": "husky"
},
"devDependencies": {
"@eslint/js": "^9.39.2",
"eslint": "^9.39.2",
"eslint-plugin-import-x": "^4.16.1",
"husky": "^9.1.7",
"lint-staged": "^16.3.3",
"prettier": "^3.7.4",
"turbo": "^2.3.3",
"typescript": "^5.7.2",
"typescript-eslint": "^8.51.0"
},
"lint-staged": {
"*.{ts,tsx,js,json,md}": "prettier --write"
},
"packageManager": "pnpm@9.15.1",
"engines": {
"node": ">=20.0.0",
Expand Down
Loading
Loading