Skip to content

Commit

Permalink
Update workflow to open a PR instead of directly pushing to main (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
popematt authored Nov 7, 2024
1 parent 7a919d8 commit 23a4e9d
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/update-formula.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ jobs:
# Don't run the cron schedule in forks
if: github.repository == 'amazon-ion/homebrew-ion-cli' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- shell: bash
Expand Down Expand Up @@ -47,9 +50,13 @@ jobs:
-e 's/ sha256 .*/ sha256 "'"$sha"'"/g' \
-e 's/ version .*/ version "'"$version"'"/g' Formula/ion-cli.rb

git config user.name github-actions
git config user.email [email protected]
# TODO: Use the bot token for pushing so that the PR can be auto-approved and merged.
git config user.name amazon-ion-bot
git config user.email [email protected]
git checkout -b "formula-update-$version"
git add -u
git commit -m "Update ion-cli formula to $tag"
git push
# In case this is a re-run, we're going to force push
git push --force --set-upstream origin "formula-update-$version"
gh pr create --fill
fi

0 comments on commit 23a4e9d

Please sign in to comment.