Update Formula #10
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |