-
Notifications
You must be signed in to change notification settings - Fork 0
28 lines (24 loc) · 1.2 KB
/
verifyFreezePeriod.yml
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
# This workflow will check if the project is currently in a Code-Freeze-Period
name: Verify Code Freeze Period
on:
workflow_call
permissions:
contents: read
jobs:
verify-freeze-period:
runs-on: ubuntu-latest
steps:
- name: Checking whether Eclipse project is currently in stabilization/code-freeze period ...
run: |
today=$(TZ=UTC date "+%Y-%m-%d")
tomorrow=$(TZ=UTC date -d "+1 days" "+%Y-%m-%d")
calId="[email protected]"
calURL="https://clients6.google.com/calendar/v3/calendars/group.calendar.google.com/events?calendarId=${calId}&singleEvents=true&timeZone=UTC&maxResults=250&sanitizeHtml=true&timeMin=${today}T00:00:00Z&timeMax=${tomorrow}T00:00:00Z&key=AIzaSyBNlYH01_9Hc5S1J9vuFmu2nUqBZJNAXxs"
echo "Querying calendar https://calendar.google.com/calendar/u/0/embed?src=${calId}"
curl "${calURL}" | grep -i -P '(stabilization|signoff|(?<!M\d) promotion)'
if [[ $? == 0 ]]; then
echo "::error::Today is a freeze day"
exit 1 #Exiting with non-0 makes this workflow fail
fi
echo "No code freeze today"
shell: bash {0} # do not fail-fast