Fix statement close behavior for direct results in SEA #1352
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Enforce Release Freeze | |
| on: | |
| pull_request: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| jobs: | |
| freeze-check: | |
| runs-on: | |
| group: databricks-protected-runner-group | |
| labels: linux-ubuntu-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| - name: Set up jq | |
| run: sudo apt-get update && sudo apt-get install -y jq | |
| - name: Fetch PR message | |
| id: pr-message | |
| env: | |
| PR_BODY: ${{ github.event.pull_request.body }} | |
| run: | | |
| # Use PR body from event payload directly (no API call needed) | |
| pr_message="$PR_BODY" | |
| # Sanitize the PR message to avoid code injection, keeping the equal sign | |
| sanitized_pr_message=$(echo "$pr_message" | sed 's/[^a-zA-Z0-9._/-=]/_/g') | |
| # Store the sanitized PR message | |
| echo "$sanitized_pr_message" > pr_message.txt | |
| echo "$sanitized_pr_message" | |
| - name: Enforce branch freeze logic | |
| shell: bash | |
| env: | |
| # GITHUB_HEAD_REF: Source branch name for PRs | |
| PR_BRANCH: ${{ github.head_ref }} | |
| run: | | |
| CONFIG_FILE="development/.release-freeze.json" | |
| # 1. Check for explicit override flag in PR message | |
| pr_message=$(cat pr_message.txt) | |
| if echo "$pr_message" | grep -q "OVERRIDE_FREEZE=true"; then | |
| echo "✅ OVERRIDE_FREEZE=true found in PR message. Freeze override permitted." | |
| exit 0 | |
| fi | |
| # 2. Proceed with freeze checks | |
| if [[ ! -f "$CONFIG_FILE" ]]; then | |
| echo "✅ No release config file - passing check." | |
| exit 0 | |
| fi | |
| FREEZE=$(jq '.freeze' "$CONFIG_FILE") | |
| if [[ "$FREEZE" != "true" ]]; then | |
| echo "✅ Freeze is off - passing check." | |
| exit 0 | |
| fi | |
| # 3. Freeze is ON and no override flag. Block PR. | |
| echo "Release freeze is ACTIVE! Branch '${PR_BRANCH}' is NOT permitted to merge." | |
| echo "To override, add OVERRIDE_FREEZE=true to your PR description." | |
| exit 1 |