remove release protector (#60755)

This commit is contained in:
Bolaji Olajide 2024-02-26 14:59:12 -06:00 committed by GitHub
parent e1bb68e75b
commit b6d929ab64
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,53 +0,0 @@
name: Release protector
on:
pull_request:
types: [edited, opened, synchronize, ready_for_review, labeled, unlabeled]
branches:
# only run on branches targeting the `main` branch.
- main
jobs:
validate_release_branch:
runs-on: ubuntu-latest
if: ${{ github.repository == 'sourcegraph/sourcegraph' && !github.event.pull_request.draft }}
outputs:
releaseBranchExists: ${{ steps.checkout.outputs.exists }}
steps:
- name: Check if latest release branch exists
id: checkout
run: |
branch="5.1"
if curl --silent -I "https://api.github.com/repos/sourcegraph/sourcegraph/git/refs/heads/${branch}" | grep "HTTP/2 200"; then
echo "::set-output name=exists::true"
else
echo "::set-output name=exists::false"
fi
protect-pr:
runs-on: ubuntu-latest
needs: validate_release_branch
# We're manually updating the release protector for now, so we only want to run it when the branch exists. If the branch doesn't exist,
# we do not need to run it.
if: ${{ needs.validate_release_branch.outputs.releaseBranchExists == 'true' }}
steps:
- name: Check backport labels during code freeze
id: check-backport-labels-during-code-freeze
run: |
# Does this PR have the acknowledgement label?
has_label="${{contains(github.event.pull_request.labels.*.name, 'confirm-no-backport') || contains(github.event.pull_request.labels.*.name, 'backport 5.0')}}"
enabled="true"
if [ ${enabled} = "true" ]; then
if [ "${has_label}" = "true" ]; then
echo "✅ Label 'confirm-no-backport or backport 5.0' is present"
exit 0
else
echo "❌ Label 'confirm-no-backport' or 'backport 5.0' is absent"
echo "👉 We're in the next Sourcegraph release code freeze period. If you are 100% sure your changes should get released or provide no risk to the release, add the 'backport 5.0' label your PR. If you don't want to include this change, add 'confirm-no-backport' to merge into main without backport."
echo "To learn more about backporting, see the handbook https://handbook.sourcegraph.com/departments/engineering/dev/tools/backport/#how-should-i-use-the-backporting-tool"
exit 1
fi
else
echo "📅 Not enabled"
exit 0
fi