feat: add brewfile validation (#1132)

* feat: add brewfile validation

* building is needed for linter to work properly

* relocate brewfiles for easier access

* remove homebrew/cask tapping

* revert the building for touching brewfiles

* Update .github/workflows/validate-brewfiles.yml

Co-authored-by: renner <80410025+renner0e@users.noreply.github.com>

---------

Co-authored-by: renner <80410025+renner0e@users.noreply.github.com>
This commit is contained in:
inffy 2025-10-22 19:03:05 +03:00 committed by GitHub
parent 184868eab1
commit 9d740ee2c5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 45 additions and 1 deletions

View file

@ -0,0 +1,40 @@
name: Validate Brewfiles
permissions:
contents: read
on:
pull_request:
paths:
- "brew/**"
jobs:
validate:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
- name: Set up Homebrew
uses: Homebrew/actions/setup-homebrew@8c478e7f5c2c2df9efba834a3568d4fe35cdb2a3
- name: Validate Brewfiles
shell: bash
run: |
echo "Validating Brewfiles..."
find "brew" -iname '*\.Brewfile*' -print0 | \
while IFS= read -r -d '' brewfile ; do \
echo "::group:: ===$(basename $brewfile)==="
grep -E -e "^tap" $brewfile > taps.Brewfile
set -xeuo pipefail
brew bundle --file=./taps.Brewfile
if brew bundle exec whoami --file="$brewfile" | grep -F -e "${USER}" ; then
echo "✓ $brewfile is valid"
else
echo "✗ $brewfile validation failed"
exit 1
fi
set +xeuo pipefail
echo "::endgroup::"
done

View file

@ -10,6 +10,7 @@ COPY /iso_files /iso_files
COPY /just /just
COPY /flatpaks /flatpaks
COPY packages.json /
COPY /brew /brew
## aurora image section
FROM ${BASE_IMAGE}:${FEDORA_MAJOR_VERSION} AS base

View file

@ -1,5 +1,4 @@
tap "gptscript-ai/tap"
tap "homebrew/cask"
brew "aichat"
brew "block-goose-cli"
brew "clio"

View file

@ -12,6 +12,10 @@ cp -r /ctx/just /tmp/just
cp /ctx/packages.json /tmp/packages.json
rsync -rvK /ctx/system_files/shared/ /
# Homebrew files
mkdir -p /usr/share/ublue-os/homebrew/
cp /ctx/brew/*.Brewfile /usr/share/ublue-os/homebrew/
mkdir -p /tmp/scripts/helpers
install -Dm0755 /ctx/build_files/shared/utils/ghcurl /tmp/scripts/helpers/ghcurl
export PATH="/tmp/scripts/helpers:$PATH"