-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (34 loc) · 1.25 KB
/
update-formula.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: Update Formula
on:
workflow_dispatch:
inputs:
version:
description: 'release version of spiceai/spiceai'
required: true
jobs:
generate:
name: Update Formula
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write
steps:
- uses: actions/checkout@v4
- name: Compute Formula
shell: bash
run: ./update-version ${{ github.event.inputs.version}}
- name: Create PR
run: |
git config --global user.name 'Spice Bot'
git config --global user.email 'spice-bot@spice.ai'
git checkout -b update-formula/${GITHUB_RUN_ID}
if [[ $(git diff --exit-code Formula/**.rb) ]]; then
git add Formula/**.rb
git commit -m "Update Formula for version ${{ github.event.inputs.version}}"
git push origin update-formula/${GITHUB_RUN_ID}
gh pr create --title "Update Formula for version ${{ github.event.inputs.version}}" --body "This PR updates the Formula for version ${{ github.event.inputs.version}}" --base trunk --head update-formula/${GITHUB_RUN_ID}
else
echo "No changes detected"
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}