2024-06-20 18:00:24 +02:00
|
|
|
name: Pull Request Base Branch
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
types: [opened, edited, synchronize]
|
|
|
|
jobs:
|
|
|
|
check_base_branch:
|
|
|
|
name: Check PR base branch
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2024-06-25 17:02:02 +02:00
|
|
|
- uses: actions/github-script@v7
|
2024-06-20 18:00:24 +02:00
|
|
|
with:
|
|
|
|
script: |
|
|
|
|
const baseBranch = context.payload.pull_request.base.ref;
|
|
|
|
if (!['develop', 'staging'].includes(baseBranch) && !baseBranch.startsWith('feat/')) {
|
|
|
|
core.setFailed(`Invalid base branch: ${baseBranch}`);
|
|
|
|
}
|