Skip to content
Merged
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
Expand Up @@ -34,6 +34,14 @@
# standardwebhooks declaration survived, which is where Ruby's ci.yml guard would sit if
# this repo's ci.yml were hand-written; it is not, and forking it for a guard is a worse
# trade than putting the guard in a test.
#
# 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
.github/workflows/publish-main.yml
src/whop_sdk/lib
tests/custom
35 changes: 35 additions & 0 deletions .github/workflows/auto-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
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: Approve
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
run: gh pr review "$PR_NUMBER" --repo "$GITHUB_REPOSITORY" --approve

- 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