fix: require exact main release branch for imgproxy

This commit is contained in:
john
2026-07-15 11:31:43 +08:00
parent 3eee44ef5b
commit e2d850c2e9
2 changed files with 5 additions and 2 deletions
@@ -25,4 +25,6 @@ test('release verifies checksums before loading the image and backs up launch st
assert.match(release, /docker load/);
assert.match(release, /imgproxy-compat-\$RELEASE_ID\.plist/);
assert.match(release, /img\.tkmind\.cn\/health/);
assert.match(release, /release\/\*/);
assert.match(release, /rev-parse origin\/main/);
});
+3 -2
View File
@@ -13,9 +13,10 @@ TMP="$(mktemp -d "${TMPDIR:-/tmp}/imgproxy-runtime-release.XXXXXX")"
cleanup() { rm -rf "$TMP"; }
trap cleanup EXIT
[[ "$(git -C "$ROOT" branch --show-current)" == "main" ]] || { echo 'imgproxy production release must run from main' >&2; exit 1; }
[[ -z "$(git -C "$ROOT" status --porcelain)" ]] || { echo 'worktree must be clean' >&2; exit 1; }
git -C "$ROOT" fetch origin main --quiet
branch="$(git -C "$ROOT" branch --show-current)"
[[ "$branch" == release/* ]] || { echo 'imgproxy production release must run from a release/* branch' >&2; exit 1; }
[[ -z "$(git -C "$ROOT" status --porcelain)" ]] || { echo 'worktree must be clean' >&2; exit 1; }
[[ "$(git -C "$ROOT" rev-parse HEAD)" == "$(git -C "$ROOT" rev-parse origin/main)" ]] || { echo 'main must match origin/main' >&2; exit 1; }
bash "$ROOT/scripts/check-release-ready.sh"