diff --git a/.github/workflows/release-protector.yml b/.github/workflows/release-protector.yml deleted file mode 100644 index 9d091dba56a..00000000000 --- a/.github/workflows/release-protector.yml +++ /dev/null @@ -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