From d4fb00a49eeeac8ed8eb397d634ede3a97487b9c Mon Sep 17 00:00:00 2001 From: alexma233 Date: Sun, 13 Sep 2026 18:29:32 +0800 Subject: [PATCH] fix(ci): make the Renovate regeneration command plain Renovate rejected the previous form because a "VAR=1 cmd" prefix needs both an allowedCommands entry and the shell executor. A plain argument keeps the task matchable by a single pattern, like the vendor hash task next to it. --- renovate.json | 2 +- scripts/dev/check-generated.sh | 18 +++++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/renovate.json b/renovate.json index 5e22a34..6092635 100644 --- a/renovate.json +++ b/renovate.json @@ -19,7 +19,7 @@ "postUpgradeTasks": { "commands": [ "bash scripts/build/update-nix-vendor-hash.sh", - "GENERATED_WRITE=1 sh scripts/dev/check-generated.sh" + "sh scripts/dev/check-generated.sh --write" ], "executionMode": "branch", "installTools": { diff --git a/scripts/dev/check-generated.sh b/scripts/dev/check-generated.sh index d41d343..05fd021 100755 --- a/scripts/dev/check-generated.sh +++ b/scripts/dev/check-generated.sh @@ -1,11 +1,23 @@ #!/usr/bin/env sh # # Regenerates the protobuf output with the tool versions CI pins and fails when -# the committed output differs. Renovate's postUpgradeTasks sets GENERATED_WRITE=1 -# to regenerate without that check, so generator bumps ship their own output. +# the committed output differs. Renovate's postUpgradeTasks passes --write to +# regenerate without that check, so generator bumps ship their own output. +# +# Usage: check-generated.sh [--write] set -eu +write=0 +case "${1:-}" in + "") ;; + --write) write=1 ;; + *) + printf 'usage: %s [--write]\n' "$0" >&2 + exit 2 + ;; +esac + ROOT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")/../.." && pwd) cd "$ROOT_DIR" @@ -23,7 +35,7 @@ GOBIN="$GOBIN_DIR" go install "connectrpc.com/connect/cmd/protoc-gen-connect-go@ deno install --frozen PATH="$GOBIN_DIR:$ROOT_DIR/node_modules/.bin:$ROOT_DIR/web/node_modules/.bin:$PATH" buf generate -if [ "${GENERATED_WRITE:-}" = "1" ]; then +if [ "$write" = "1" ]; then exit 0 fi -- 2.51.2