From 3a47b64fc044d56d2a3781f223e98c8274a21a08 Mon Sep 17 00:00:00 2001 From: arezaii Date: Mon, 16 Dec 2024 11:56:47 -0700 Subject: [PATCH 1/2] Create monitor-homebrew.yml --- .github/workflows/monitor-homebrew.yml | 47 ++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/monitor-homebrew.yml diff --git a/.github/workflows/monitor-homebrew.yml b/.github/workflows/monitor-homebrew.yml new file mode 100644 index 000000000000..2de46602df96 --- /dev/null +++ b/.github/workflows/monitor-homebrew.yml @@ -0,0 +1,47 @@ +name: Monitor Homebrew Formula + +on: + schedule: + - cron: '0 * * * *' # Runs every hour + +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 "you@example.com" + 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' From faba35187282d7ec5e52feb2d9822036b51db9e5 Mon Sep 17 00:00:00 2001 From: arezaii Date: Mon, 16 Dec 2024 12:17:29 -0700 Subject: [PATCH 2/2] Update monitor-homebrew.yml --- .github/workflows/monitor-homebrew.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/monitor-homebrew.yml b/.github/workflows/monitor-homebrew.yml index 2de46602df96..c982cb1ace4b 100644 --- a/.github/workflows/monitor-homebrew.yml +++ b/.github/workflows/monitor-homebrew.yml @@ -1,8 +1,6 @@ name: Monitor Homebrew Formula -on: - schedule: - - cron: '0 * * * *' # Runs every hour +on: workflow_dispatch jobs: check-and-update: