feat: auto-select browser for external auth

This commit is contained in:
Kevin Yue committed 2026-06-21 20:59:13 +08:00
1 parent b32002710b
commit ecc9c9f09c
7 files changed
+144 -47

No files matched your search

+33
View File
@@ -0,0 +1,33 @@
#!/usr/bin/env bash
set -euo pipefail
release_version="${1:-}"
if git diff --quiet -- flake.nix; then
echo "flake.nix hashes are already up to date"
exit 0
fi
if [[ -z "$release_version" ]]; then
release_version="$(grep '^version' Cargo.toml | head -1 | sed 's/version *= *"\(.*\)"/\1/')"
fi
version="${release_version#v}"
branch="chore/update-flake-hashes-v${version}"
title="chore: update flake hashes for v${version}"
body="Updates the Nix flake fetchzip hashes for v${version} release assets."
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git switch -C "$branch"
git add flake.nix
git commit -m "$title"
git push --force-with-lease origin "$branch"
if gh pr view "$branch" --json number > /tmp/flake-pr.json 2> /dev/null; then
pr_number="$(jq -r '.number' /tmp/flake-pr.json)"
gh pr edit "$pr_number" --title "$title" --body "$body"
else
gh pr create --title "$title" --body "$body" --base main --head "$branch"
fi