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

Arezaii test hb monitor #1

Merged
merged 2 commits into from
Dec 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/monitor-homebrew.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Monitor Homebrew Formula

on: workflow_dispatch

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
if: env.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

- name: Create a pull request
if: env.file_changed == 'true'
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: update-chapel-main
title: 'Update chapel-main.rb'
body: 'This pull request updates chapel-main.rb with the latest changes from chapel.rb.'
labels: 'auto-update'
Loading