-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Expand file tree
/
Copy pathauto-label-not-ready-for-e2e.yml
More file actions
35 lines (33 loc) · 1.11 KB
/
auto-label-not-ready-for-e2e.yml
File metadata and controls
35 lines (33 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# Automatically applies the 'pr-not-ready-for-e2e' label to newly opened PRs,
# but only if the PR is opened between 13:00 and 17:00 UTC (15:00–19:00 CEST).
name: Auto-apply pr-not-ready-for-e2e label
on:
pull_request:
types: [opened]
branches-ignore:
- 'release/**'
- 'stable'
jobs:
add-label:
if: github.event.pull_request.head.repo.fork == false
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Check current UTC hour
id: time-check
run: |
HOUR=$(date -u +%H)
echo "Current UTC hour: $HOUR"
if [[ $HOUR -ge 13 && $HOUR -lt 17 ]]; then
echo "in_window=true" >> "$GITHUB_OUTPUT"
else
echo "in_window=false" >> "$GITHUB_OUTPUT"
fi
- name: Add pr-not-ready-for-e2e label
if: steps.time-check.outputs.in_window == 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
PR_NUMBER: ${{ github.event.pull_request.number }}
run: gh pr edit "$PR_NUMBER" --add-label "pr-not-ready-for-e2e"