包含Go API项目的所有源代码、配置文件、Docker配置、文档和前端资源 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
21 lines
721 B
YAML
21 lines
721 B
YAML
name: Check PR Branching Strategy
|
|
on:
|
|
pull_request:
|
|
types: [opened, synchronize, reopened, edited]
|
|
|
|
jobs:
|
|
check-branching-strategy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Enforce branching strategy
|
|
run: |
|
|
if [[ "${{ github.base_ref }}" == "main" ]]; then
|
|
if [[ "${{ github.head_ref }}" != "alpha" ]]; then
|
|
echo "Error: Pull requests to 'main' are only allowed from the 'alpha' branch."
|
|
exit 1
|
|
fi
|
|
elif [[ "${{ github.base_ref }}" != "alpha" ]]; then
|
|
echo "Error: Pull requests must be targeted to the 'alpha' or 'main' branch."
|
|
exit 1
|
|
fi
|
|
echo "Branching strategy check passed." |