Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add action to prevent merges while frozen zone period (New Year transition) [skip chromatic] #1649

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/frozen-zone.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Prevent Merges During Frozen Zone Period

on:
pull_request:
types: [opened, edited, reopened, synchronize]
pull_request_review:
types: [submitted]

jobs:
freeze-check:
runs-on: ubuntu-latest
steps:
- name: Check for Frozen Zone
run: |
TARGET_BRANCH="${{ github.event.pull_request.base.ref }}"
FREEZE_START="2024-12-16T00:00:00Z"
FREEZE_END="2025-01-10T23:59:59Z"
CURRENT_TIME=$(date -u +"%Y-%m-%dT%H:%M:%SZ")

echo "Target branch is $TARGET_BRANCH"
echo "Current time is $CURRENT_TIME"

if [[ "$TARGET_BRANCH" == "main" ]]; then
if [[ "$CURRENT_TIME" > "$FREEZE_START" && "$CURRENT_TIME" < "$FREEZE_END" ]]; then
echo "🚫 We are in a freeze period. No merges allowed to 'main'!"
exit 1
else
echo "✅ Not in a freeze period. Merging to 'main' is allowed."
fi
else
echo "✅ Target branch is not 'main'. Skipping freeze check."
fi
Loading