mirror of
https://github.com/better-auth/better-auth.git
synced 2026-05-23 23:52:05 -05:00
37 lines
1.1 KiB
YAML
37 lines
1.1 KiB
YAML
name: Branch Rules
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
- canary
|
|
- 'v*-staging'
|
|
|
|
jobs:
|
|
check-branch:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Filter changed files
|
|
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
|
|
id: filter
|
|
with:
|
|
base: ${{ github.base_ref }}
|
|
filters: |
|
|
# 'src' filter matches any file NOT in the docs/ directory
|
|
src:
|
|
- '!docs/**'
|
|
# 'docs' filter matches any file in the docs/ directory
|
|
docs:
|
|
- 'docs/**'
|
|
|
|
- name: Enforce code change PRs target canary or staging
|
|
if: steps.filter.outputs.src == 'true' && github.base_ref != 'canary' && !startsWith(github.base_ref, 'v')
|
|
run: |
|
|
echo "Error: Pull requests with code changes must target 'canary' or a versioned staging branch (e.g., 'v1.2.3-staging')."
|
|
exit 1
|