From 1a53b2cddd75ba555027e562adb73a280a4d9998 Mon Sep 17 00:00:00 2001 From: erpranavjoshi <52619253+erpranavjoshi@users.noreply.github.com> Date: Fri, 28 Feb 2025 17:56:20 +0530 Subject: [PATCH 1/2] updated random thing --- abc.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 abc.txt diff --git a/abc.txt b/abc.txt new file mode 100644 index 0000000..d27399a --- /dev/null +++ b/abc.txt @@ -0,0 +1 @@ +sdbcmxzhb From fd14d8fcbaf40c28e0b241f49c9d182f78207786 Mon Sep 17 00:00:00 2001 From: erpranavjoshi <52619253+erpranavjoshi@users.noreply.github.com> Date: Fri, 28 Feb 2025 18:16:50 +0530 Subject: [PATCH 2/2] Update time-based-pr-approvals.yml --- .github/workflows/time-based-pr-approvals.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/time-based-pr-approvals.yml b/.github/workflows/time-based-pr-approvals.yml index 89070df..c6b8492 100644 --- a/.github/workflows/time-based-pr-approvals.yml +++ b/.github/workflows/time-based-pr-approvals.yml @@ -1,7 +1,7 @@ name: Enforce PR Approval Time Rules on: - pull_request_review: - types: [submitted] + pull_request: + types: [opened, synchronize] jobs: check-approval-time: @@ -18,15 +18,18 @@ jobs: repo: context.repo.repo, issue_number: prNumber }); - return labels.map(label => label.name); + core.setOutput("labels", labels.map(label => label.name).join(',')); - name: Check Approval Time run: | EMERGENCY_LABEL="emergency-approval" - PR_LABELS="${{ steps.labels.outputs.result }}" + PR_LABELS="${{ steps.labels.outputs.labels }}" CURRENT_HOUR=$(date -u +%H) ALLOWED_START=9 # 9 AM UTC - ALLOWED_END=18 # 6 PM UTC + ALLOWED_END=11 # 6 PM UTC + + echo "PR Labels: $PR_LABELS" + echo "Current UTC Hour: $CURRENT_HOUR" if [[ "$PR_LABELS" == *"$EMERGENCY_LABEL"* ]]; then echo "🚨 Emergency approval detected! Bypassing time restriction."