mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 17:31:43 +00:00
Add a GHA to check PRs on 4.0, blocking them if label is not present (only post release date) (#40984)
Co-authored-by: Thorsten Ball <mrnugget@gmail.com>
This commit is contained in:
parent
b13aa3ae34
commit
5b6f2c08bc
32
.github/workflows/fourpointoh-protector.yml
vendored
Normal file
32
.github/workflows/fourpointoh-protector.yml
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
name: Sourcegraph 4.0 code freeze
|
||||
on:
|
||||
pull_request:
|
||||
types: [ closed, edited, opened, synchronize, ready_for_review, labeled, unlabeled]
|
||||
branches:
|
||||
# only run on branches targeting the `main` branch.
|
||||
- main
|
||||
|
||||
jobs:
|
||||
protect-pr:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check date and labels
|
||||
id: check-date-and-labels
|
||||
run: |
|
||||
has_label="${{contains(github.event.pull_request.labels.*.name, 'i-acknowledge-this-goes-into-4.0')}}"
|
||||
today=$(date +'%Y%m%d%H%M')
|
||||
dday="202209090000"
|
||||
|
||||
if [ "$today" -gt "$dday" ]; then
|
||||
if [ "$has_label" = "true" ]; then
|
||||
echo "✅ Label 'i-acknowledge-this-goes-into-4.0' is present"
|
||||
exit 0
|
||||
else
|
||||
echo "❌ Label 'i-acknowledge-this-goes-into-4.0' is absent"
|
||||
echo "👉 We're in the Sourcegraph 4.0 code freeze. If you are 100% sure your changes should go in 4.0 or provide no risk to the release 4.0, add the label your PR with 'i-acknowledge-this-goes-into-4.0''"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "📅 Not enabled, we're not yet on 2022-09-09 and 4.0 code freeze has not started yet."
|
||||
exit 0
|
||||
fi
|
||||
Loading…
Reference in New Issue
Block a user