From afb733f02a37072b7e337fad86acbba14d584e60 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Wed, 22 Apr 2026 18:58:36 -0700 Subject: [PATCH] Don't allow merging PRs with the `dependent` label. (#7096) This should reduce the chance of a dependent PR being merged before its base PR is merged. Assisted-by: Gemini via Antigravity --- .github/workflows/check_dependent.yaml | 29 ++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/check_dependent.yaml diff --git a/.github/workflows/check_dependent.yaml b/.github/workflows/check_dependent.yaml new file mode 100644 index 000000000000..220a1da286bf --- /dev/null +++ b/.github/workflows/check_dependent.yaml @@ -0,0 +1,29 @@ +# Part of the Carbon Language project, under the Apache License v2.0 with LLVM +# Exceptions. See /LICENSE for license information. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +name: Check Dependent Label +on: + pull_request_target: + types: [opened, synchronize, labeled, unlabeled] + +jobs: + check_label: + runs-on: ubuntu-latest + steps: + - name: Harden Runner + uses: step-security/harden-runner@58077d3c7e43986b6b15fba718e8ea69e387dfcc # v2.15.1 + with: + disable-sudo: true + egress-policy: block + # prettier-ignore + allowed-endpoints: > + api.github.com:443 + + - name: Check for 'dependent' label + run: | + if [[ "${{ contains(github.event.pull_request.labels.*.name, 'dependent') }}" == "true" ]]; then + echo "PR has 'dependent' label. Blocking merge." + exit 1 + fi + echo "PR does not have 'dependent' label."