From 3822096a2e8250063bbce3cf08a54cf0d3cdfe82 Mon Sep 17 00:00:00 2001 From: Ruoyu Zhong Date: Tue, 6 Aug 2024 09:13:22 +0800 Subject: [PATCH] workflows/clean-up-closed-prs: don't try to delete branch if PR is from fork Otherwise you can delete a branch from this repo with a PR opened from a fork's branch with the same name. --- .github/workflows/clean-up-closed-prs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/clean-up-closed-prs.yml b/.github/workflows/clean-up-closed-prs.yml index 7b15edb18300..03365829eafd 100644 --- a/.github/workflows/clean-up-closed-prs.yml +++ b/.github/workflows/clean-up-closed-prs.yml @@ -57,6 +57,7 @@ jobs: delete-branch: if: > github.repository_owner == 'Homebrew' && + github.event.pull_request.head.repo.full_name == github.repository && !github.event.pull_request.merged runs-on: ubuntu-latest # Ignore errors as branch may already be deleted