Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions scripts/cargo-update-and-push.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash -eu
# Runs `cargo update`, runs local tests, pushes w/ automerge on success.

cd "$(dirname "$(readlink -m "$0")")/.."

if [[ -n "$(git status --porcelain)" ]]; then
echo "There are uncommitted changes" >&2
exit 1
fi

cargo update
cargo test
git commit -a -m 'Run cargo-update'
git checkout -B cargo-update
git push --set-upstream github HEAD:cargo-update

pr_url=$(gh pr create \
--title='Run cargo-update' \
--body='Autogenerated by cargo-update-and-push.sh.')
echo "Posted update PR as ${pr_url}."

gh pr merge "${pr_url}" --auto --delete-branch --squash
echo "Set autosubmit."