Skip to content

Commit 535d2bc

Browse files
committed
Merge remote-tracking branch 'databricks/main' into jayantsing-db/schemas-all-catalogs
2 parents a7964c9 + 7e057dc commit 535d2bc

2 files changed

Lines changed: 65 additions & 0 deletions

File tree

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Enforce Release Freeze
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
7+
jobs:
8+
freeze-check:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Check out repository
13+
uses: actions/checkout@v4
14+
15+
- name: Set up jq
16+
run: sudo apt-get update && sudo apt-get install -y jq
17+
18+
- name: Enforce branch freeze logic
19+
shell: bash
20+
env:
21+
# GITHUB_HEAD_REF: Source branch name for PRs
22+
PR_BRANCH: ${{ github.head_ref }}
23+
run: |
24+
CONFIG_FILE="development/.release-config.json"
25+
26+
if [[ ! -f "$CONFIG_FILE" ]]; then
27+
echo "✅ No release config file - passing check."
28+
exit 0
29+
fi
30+
31+
FREEZE=$(jq '.freeze' "$CONFIG_FILE")
32+
33+
if [[ "$FREEZE" != "true" ]]; then
34+
echo "✅ Freeze is off - passing check."
35+
exit 0
36+
fi
37+
38+
ALLOW_LIST=( $(jq -r '.allow_list[]' "$CONFIG_FILE") )
39+
40+
BRANCH="$PR_BRANCH"
41+
ALLOWED=0
42+
43+
# Check for exact branch name in allow_list
44+
for ENTRY in $(jq -r '.allow_list[]' "$CONFIG_FILE"); do
45+
if [[ "$BRANCH" == "$ENTRY" ]]; then
46+
ALLOWED=1
47+
break
48+
fi
49+
done
50+
51+
if [[ "$ALLOWED" == "1" ]]; then
52+
echo "✅ Branch '$BRANCH' is in allow_list. Passing check."
53+
exit 0
54+
else
55+
echo "❌ Release freeze is ACTIVE!"
56+
REASON=$(jq -r '.reason' "$CONFIG_FILE")
57+
echo "Reason: $REASON"
58+
echo "Branch '$BRANCH' is NOT permitted to merge under current freeze rules."
59+
exit 1
60+
fi

development/.release-freeze.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"freeze": false,
3+
"reason": "Release description",
4+
"allow_list": []
5+
}

0 commit comments

Comments
 (0)