From 1ced60baeb199ad8e26b6ce86b6abbd497eda5d5 Mon Sep 17 00:00:00 2001 From: Sean Molenaar Date: Sun, 11 Feb 2024 16:31:27 +0100 Subject: [PATCH] feat: add CI to detect references --- .github/workflows/check-reference.yml | 34 +++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/check-reference.yml diff --git a/.github/workflows/check-reference.yml b/.github/workflows/check-reference.yml new file mode 100644 index 00000000..f65dbf48 --- /dev/null +++ b/.github/workflows/check-reference.yml @@ -0,0 +1,34 @@ +name: Check patch references + +on: + push: + branches-ignore: + - dependabot/** + schedule: + # Once every day at midnight UTC + - cron: "0 0 * * *" + +jobs: + stale: + runs-on: ubuntu-latest + steps: + - name: Checkout patches + uses: actions/checkout@v4 + + - name: Checkout core + uses: actions/checkout@v4 + with: + repository: 'homebrew/homebrew-core' + path: homebrew-core + + - name: Detect references + run: | + patches=$(find -name "*.patch") + status=0 + for patch in $patches; do + if ! git -C "homebrew-core" grep -r "${patch/./}" > /dev/null; then + echo "$patch not needed!" + status=1 + fi + done + exit $status