Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add CI to detect references #905

Closed
wants to merge 16 commits into from
Closed
34 changes: 34 additions & 0 deletions .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:
SMillerDev marked this conversation as resolved.
Show resolved Hide resolved
SMillerDev marked this conversation as resolved.
Show resolved Hide resolved
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
SMillerDev marked this conversation as resolved.
Show resolved Hide resolved
run: |
patches=$(find -name "*.patch" -printf "%f\n")
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
issyl0 marked this conversation as resolved.
Show resolved Hide resolved
exit $status