From 87651c95dc05de4df999c7c1c205c2b072fbf9f3 Mon Sep 17 00:00:00 2001 From: Lukasz Raczylo Date: Sat, 10 Oct 2026 01:31:40 +0100 Subject: [PATCH] feat(autoupdate): add build-tags input to renovate-autoupdate (#9) The default Go build and test step has no way to pass build tags. A repository that needs tags, such as fts5, fails its scheduled run. The new build-tags input defaults to an empty string. With tags set, the step must run go build and go test with -tags. It also sets CGO_ENABLED=1, as go-pr.yaml does. Without tags, the commands stay unchanged. The go-test-command input still replaces the default commands. --- .github/workflows/renovate-autoupdate.yaml | 10 ++++++++++ README.md | 1 + 2 files changed, 11 insertions(+) diff --git a/.github/workflows/renovate-autoupdate.yaml b/.github/workflows/renovate-autoupdate.yaml index 4ebd00f..16c1b6d 100644 --- a/.github/workflows/renovate-autoupdate.yaml +++ b/.github/workflows/renovate-autoupdate.yaml @@ -43,6 +43,11 @@ on: required: false type: string default: "" + build-tags: + description: "Build tags to pass to go build and go test (e.g., 'fts5'). The default commands then run with CGO_ENABLED=1. Ignored when go-test-command is set." + required: false + type: string + default: "" node: description: "Update and test the Node project. Turn off for a repo with no frontend to test." required: false @@ -461,6 +466,7 @@ jobs: working-directory: ${{ inputs.go-working-directory }} env: GO_TEST_COMMAND: ${{ inputs.go-test-command }} + TAGS: ${{ inputs.build-tags }} GOTOOLCHAIN: auto run: | set -o pipefail @@ -468,6 +474,10 @@ jobs: go mod verify if [ -n "$GO_TEST_COMMAND" ]; then bash -c "$GO_TEST_COMMAND" + elif [ -n "$TAGS" ]; then + export CGO_ENABLED=1 + go build -tags "$TAGS" ./... + go test -tags "$TAGS" -race -cover ./... else go build ./... go test -race -cover ./... diff --git a/README.md b/README.md index b7c1eb4..aa2f103 100644 --- a/README.md +++ b/README.md @@ -188,6 +188,7 @@ The workflow finds `go.mod` and `package.json` itself and tests what exists. A r | `go-mod-tidy` | `true` | Run `go mod tidy` after a Go update. Turn it off for an Encore app, where tidy prunes `go.sum` entries the build needs. | | `go-prepare-command` | | Shell commands to run before the Go tests, for example installing a CLI. Append a tool directory to `$GITHUB_PATH` to put it on `PATH`. | | `go-test-command` | | Replaces the default `go build` and `go test`, for example `encore test ./...` for an Encore app. | +| `build-tags` | | Build tags for the default `go build` and `go test`, for example `fts5`. Also sets `CGO_ENABLED=1`. Ignored when `go-test-command` is set. | | `node-version` | `22` | Node.js version | | `node` | `true` | Update and test the Node project. Turn off for a repo with no frontend to test. | | `node-working-directory` | `.` | Directory that holds `package.json`. Only this project is updated and tested. With `node-workspace`, the directory that holds the workspace files. |