-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update workflow to open a PR instead of directly pushing to main (#15)
- Loading branch information
Showing
1 changed file
with
10 additions
and
3 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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 |