38 lines
1.2 KiB
YAML
38 lines
1.2 KiB
YAML
name: PR target branch
|
|
|
|
"on":
|
|
pull_request:
|
|
types: [opened, edited, synchronize, reopened, ready_for_review, labeled, unlabeled]
|
|
|
|
permissions:
|
|
contents: read
|
|
pull-requests: read
|
|
|
|
jobs:
|
|
validate-target:
|
|
name: Validate target branch
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check out trusted workflow scripts
|
|
uses: actions/checkout@v4
|
|
with:
|
|
ref: ${{ github.event.repository.default_branch }}
|
|
persist-credentials: false
|
|
|
|
- name: Check out bootstrap validator before first merge
|
|
if: ${{ hashFiles('.github/scripts/validate-pr-target-branch.sh') == '' }}
|
|
uses: actions/checkout@v4
|
|
with:
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
|
persist-credentials: false
|
|
|
|
- name: Validate target branch
|
|
env:
|
|
PR_BASE_REF: ${{ github.event.pull_request.base.ref }}
|
|
PR_HEAD_REF: ${{ github.event.pull_request.head.ref }}
|
|
PR_LABELS: ${{ join(github.event.pull_request.labels.*.name, ',') }}
|
|
PR_NUMBER: ${{ github.event.pull_request.number }}
|
|
PR_TITLE: ${{ github.event.pull_request.title }}
|
|
GH_TOKEN: ${{ github.token }}
|
|
run: bash .github/scripts/validate-pr-target-branch.sh
|