Skip to content

feat(database): add attribute schema tables and soft-delete triggers #33

feat(database): add attribute schema tables and soft-delete triggers

feat(database): add attribute schema tables and soft-delete triggers #33

# SPDX-License-Identifier: Apache-2.0
# © Crown Copyright 2025. This work has been developed by the National Digital Twin Programme and is legally attributed to the Department for Business and Trade (UK) as the governing entity.
name: GitFlow - PR Target Check
on:
pull_request:
permissions: {}
jobs:
pr-target-check:
if: github.actor != 'dependabot[bot]'
runs-on: ubuntu-latest
steps:
- name: Check merge target
env:
BASE_BRANCH: ${{ github.base_ref }}
HEAD_BRANCH: ${{ github.head_ref }}
run: |
# Allow merging feature, hotfix, bugfix, or dependabot into develop
if [[ "$HEAD_BRANCH" =~ ^(feature/|hotfix/|bugfix/|dependabot/) && "$BASE_BRANCH" == "develop" ]]; then
echo "Allowed: $HEAD_BRANCH → $BASE_BRANCH"
exit 0
fi
# Allow merging release or hotfix into main
if [[ "$HEAD_BRANCH" =~ ^(release/|hotfix/).*$ && "$BASE_BRANCH" == "main" ]]; then
echo "Allowed: $HEAD_BRANCH → $BASE_BRANCH"
exit 0
fi
# Allow merging sync branches into intermediate-sync (Automated Fork Sync)
if [[ "$HEAD_BRANCH" =~ ^sync/ && "$BASE_BRANCH" == "intermediate-sync" ]]; then
echo "Allowed: $HEAD_BRANCH → $BASE_BRANCH"
exit 0
fi
# If none of the above conditions match, block the PR
echo "Error: Invalid PR - '$HEAD_BRANCH' cannot be merged into '$BASE_BRANCH'."
echo "Allowed merges:"
echo " - feature/*, hotfix/*, bugfix/*, dependabot/* → develop"
echo " - release/*, hotfix/* → main"
echo " - sync/* → intermediate-sync"
exit 1