Skip to content

Commit fcd72d5

Browse files
Copilotcastrojogithub-advanced-security[bot]Copilot
authored
feat(ci): add Brewfile validation workflow for /brew directory (#3432)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: castrojo <1264109+castrojo@users.noreply.github.com> Co-authored-by: Jorge O. Castro <jorge.castro@gmail.com> Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent b62f888 commit fcd72d5

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Validate Brewfiles
2+
permissions:
3+
contents: read
4+
5+
on:
6+
pull_request:
7+
paths:
8+
- "brew/**"
9+
jobs:
10+
validate:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
15+
16+
- name: Set up Homebrew
17+
uses: Homebrew/actions/setup-homebrew@v3
18+
19+
- name: Validate Brewfiles
20+
shell: bash
21+
run: |
22+
echo "Validating Brewfiles in brew/ directory..."
23+
EXIT_CODE=0
24+
25+
for brewfile in brew/*.Brewfile; do
26+
if [ -f "$brewfile" ]; then
27+
echo "Checking $brewfile..."
28+
if brew bundle check --file="$brewfile" --no-upgrade; then
29+
echo "✓ $brewfile is valid"
30+
else
31+
echo "✗ $brewfile validation failed"
32+
EXIT_CODE=1
33+
fi
34+
fi
35+
done
36+
37+
if [ $EXIT_CODE -eq 0 ]; then
38+
echo "All Brewfiles are valid!"
39+
else
40+
echo "Some Brewfiles failed validation"
41+
exit 1
42+
fi

0 commit comments

Comments
 (0)