From 45f71661bbc0885dd1c77c7fd0980d716014bd67 Mon Sep 17 00:00:00 2001 From: Sierra1011 <43705549+Sierra1011@users.noreply.github.com> Date: Fri, 24 Jul 2026 15:36:52 +0100 Subject: [PATCH] mise: add sync-lint-config task pulling canonical .golangci.yml Depends on SierranaTech/actions#51. Same shape as fluxcast (86229fc) and microservice-operator#17. --- .mise.toml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.mise.toml b/.mise.toml index fa63967..a2d80cf 100644 --- a/.mise.toml +++ b/.mise.toml @@ -38,3 +38,19 @@ go vet ./... go test -count=1 -race ./... go build -o bin/hawk ./cmd/hawk """ + +[tasks.sync-lint-config] +description = "Sync .golangci.yml from SierranaTech/actions (canonical)" +# gh api rather than curl: actions repo is private, so the fetch needs +# the caller's gh auth (locally) or a GITHUB_TOKEN with contents:read on +# that repo (CI). See SierranaTech/actions/golangci-lint/README.md. +# Write to a temp file first: on failure, .golangci.yml is preserved +# (a naive redirect would clobber it with the 4xx error body). +run = ''' +set -euo pipefail +tmp=$(mktemp) +trap 'rm -f "$tmp"' EXIT +gh api -H 'Accept: application/vnd.github.raw' \ + 'repos/SierranaTech/actions/contents/golangci-lint/common.yml' > "$tmp" +mv "$tmp" .golangci.yml +'''