Skip to content

Monitor Homebrew Formula #2

Monitor Homebrew Formula

Monitor Homebrew Formula #2

name: Monitor Homebrew Formula
on: workflow_dispatch
env:
file_changed: false
jobs:
check-and-update:
runs-on: ubuntu-latest
steps:
- name: Checkout this repository
uses: actions/checkout@v4
- name: Fetch released version of Chapel formula
run: |
curl -o hb_master_chapel.rb https://raw.githubusercontent.com/homebrew/homebrew-core/master/Formula/c/chapel.rb
- name: Compare the released version with the chapel-release.rb
id: compare
run: |
if ! cmp -s remote_chapel.rb util/packaging/homebrew/chapel-release.rb; then
echo "file_changed=true" >> $GITHUB_ENV
else
echo "file_changed=false" >> $GITHUB_ENV
fi
- name: Create a new branch if file has changed
env:
file_changed: ${{ steps.compare.outputs.file_changed }}
if: $file_changed == 'true'

Check failure on line 32 in .github/workflows/monitor-homebrew.yml

GitHub Actions / Monitor Homebrew Formula

Invalid workflow file

The workflow is not valid. .github/workflows/monitor-homebrew.yml (Line: 32, Col: 11): Unexpected symbol: '$file_changed'. Located at position 1 within expression: $file_changed == 'true'
run: |
git config --global user.email "[email protected]"
git config --global user.name "Your Name"
git checkout -b update-chapel-main
mv remote_chapel.rb chapel-main.rb
git add chapel-main.rb
git commit -m "Update chapel-main.rb with changes from chapel.rb"
git push --set-upstream origin update-chapel-main
echo "Homebrew has updated the formula!"