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
16 changes: 13 additions & 3 deletions .github/workflows/auto-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ name: Request Auto-Merge

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

permissions:
contents: write
pull-requests: write
contents: read
pull-requests: read

jobs:
request-auto-merge:
Expand All @@ -15,9 +16,18 @@ jobs:
!startsWith(github.event.pull_request.head.ref, 'release-please--')
runs-on: ubuntu-latest
steps:
- name: Create delivery token
id: delivery-token
uses: actions/create-github-app-token@v2
with:
app-id: ${{ vars.CHIO_DELIVERY_APP_ID }}
private-key: ${{ secrets.CHIO_DELIVERY_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
repositories: ${{ github.event.repository.name }}

- name: Request squash auto-merge
env:
GH_TOKEN: ${{ github.token }}
GH_TOKEN: ${{ steps.delivery-token.outputs.token }}
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
PR_URL: ${{ github.event.pull_request.html_url }}
run: >-
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ This repository owns organization-wide GitHub workflow policy.

`auto-merge.yml` requests squash auto-merge for ready, same-repository pull requests. Repository
rulesets and required checks remain authoritative: GitHub merges only after every required check
passes. Release Please branches are excluded because each product's release workflow validates and
merges those pull requests itself.
passes. It uses an organization-owned GitHub App so the resulting merge can trigger downstream
delivery workflows. Release Please branches are excluded because each product's release workflow
validates those pull requests and requests auto-merge itself with the same App identity.

The organization ruleset applies this workflow to Chio Labs public repositories.

Draft and fork-based pull requests are intentionally excluded. Release Please pull requests remain
owned by each product's release workflow.
Draft and fork-based pull requests are intentionally excluded. A draft is handled when it becomes
ready for review. Release Please pull requests remain owned by each product's release workflow.