Skip to content

Commit 0d20dae

Browse files
committed
add cargo-update-and-push script
1 parent 14d9229 commit 0d20dae

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

scripts/cargo-update-and-push.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash -eu
2+
# Runs `cargo update`, runs local tests, pushes w/ automerge on success.
3+
4+
cd "$(dirname "$(readlink -m "$0")")/.."
5+
6+
if [[ -n "$(git status --porcelain)" ]]; then
7+
echo "There are uncommitted changes" >&2
8+
exit 1
9+
fi
10+
11+
cargo update
12+
cargo test
13+
git commit -a -m 'Run cargo-update'
14+
git checkout -B cargo-update
15+
git push --set-upstream github HEAD:cargo-update
16+
17+
pr_url=$(gh pr create \
18+
--title='Run cargo-update' \
19+
--body='Autogenerated by cargo-update-and-push.sh.')
20+
echo "Posted update PR as ${pr_url}."
21+
22+
gh pr merge "${pr_url}" --auto --delete-branch --squash
23+
echo "Set autosubmit."

0 commit comments

Comments
 (0)