Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
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
8 changes: 8 additions & 0 deletions .fernignore
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
# Specify files that shouldn't be modified by Fern
#
# auto-merge.yml is hand-written and arms Fern's own regeneration PRs. On pull_request_target
# it enables auto-merge (squash) for a pull request opened by fern-api[bot] from an in-repo
# fern-bot/* branch against the default branch, so the pull request merges itself once main's
# required status checks pass. The trigger is pull_request_target rather than pull_request so
# the workflow that arms a pull request is always the copy already on the base branch, never
# the copy that pull request carries.
.github/workflows/auto-merge.yml
29 changes: 29 additions & 0 deletions .github/workflows/auto-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Auto-merge

on:
pull_request_target:
types: [opened, reopened, synchronize]

permissions:
contents: write
pull-requests: write

concurrency:
group: auto-merge-${{ github.event.pull_request.number }}
cancel-in-progress: false

jobs:
arm:
if: >-
github.event.pull_request.user.id == 115122769 &&
github.event.pull_request.user.login == 'fern-api[bot]' &&
github.event.pull_request.head.repo.full_name == github.repository &&
github.event.pull_request.base.ref == github.event.repository.default_branch &&
startsWith(github.event.pull_request.head.ref, 'fern-bot/')
runs-on: ubuntu-latest
steps:
- name: Enable auto-merge
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
run: gh pr merge "$PR_NUMBER" --repo "$GITHUB_REPOSITORY" --auto --squash
Loading