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
21 changes: 16 additions & 5 deletions scripts/cargo-update-and-push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,25 @@ if [[ -n "$(git status --porcelain)" ]]; then
exit 1
fi

git fetch
branch_name=cargo-update

if [[ "$(git branch -r)" == *"github/${branch_name}"* ]]; then
Comment thread
gburgessiv marked this conversation as resolved.
echo "Deleting remote branch..."
git push github --delete "${branch_name}"
fi

if [[ "$(git branch --show-current 2>&1 || :)" != "main" ]]; then
echo "Switching to main..."
git switch main
git pull
fi

cargo update
cargo test
if git rev-parse cargo-update 2>/dev/null >/dev/null; then
git branch -D cargo-update
fi
git checkout -b cargo-update
git checkout -B "${branch_name}"
git commit -a -m 'Run cargo-update'
git push --set-upstream github HEAD:cargo-update
git push --set-upstream github HEAD:"${branch_name}"

pr_url=$(gh pr create \
--title='Run cargo-update' \
Expand Down