From d0370ddc22b5e286d83bc12fecb7a86aa041accd Mon Sep 17 00:00:00 2001 From: mozillazg Date: Mon, 29 Apr 2024 21:17:22 +0800 Subject: [PATCH] ci: add renovate --- .github/renovate.json5 | 115 +++++++++++++++++++++++++++++++++++++++++ go.mod | 2 +- 2 files changed, 116 insertions(+), 1 deletion(-) create mode 100644 .github/renovate.json5 diff --git a/.github/renovate.json5 b/.github/renovate.json5 new file mode 100644 index 00000000..c4a286ca --- /dev/null +++ b/.github/renovate.json5 @@ -0,0 +1,115 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": [ + "config:base", + ":gitSignOff", + "helpers:pinGitHubActionDigests" + ], + // This ensures that the gitAuthor and gitSignOff fields match + "gitAuthor": "renovate[bot] ", + "includePaths": [ + ".github/workflows/**", + "go.mod", + "go.sum", + "Dockerfile", + ], + postUpdateOptions: [ + "gomodTidy" + ], + "pinDigests": true, + "ignorePresets": [":prHourlyLimit2"], + "separateMajorMinor": true, + "separateMultipleMajor": true, + "separateMinorPatch": true, + "pruneStaleBranches": true, + "baseBranches": [ + "main" + ], + "vulnerabilityAlerts": { + "enabled": true + }, + "labels": [ + "dependencies", + "renovate/stop-updating", + ], + "stopUpdatingLabel": "renovate/stop-updating", + "packageRules": [ + { + "groupName": "all github action dependencies", + "groupSlug": "all-github-action", + "matchPaths": [ + ".github/workflows/**" + ], + "matchUpdateTypes": [ + "major", + "minor", + "digest", + "patch", + "pin", + "pinDigest" + ] + }, + { + "groupName": "all go dependencies main", + "groupSlug": "all-go-deps-main", + "matchFiles": [ + "go.mod", + "go.sum" + ], + "postUpdateOptions": [ + // update source import paths on major updates + "gomodUpdateImportPaths", + ], + "matchUpdateTypes": [ + "major", + "minor", + "digest", + "patch", + "pin", + "pinDigest" + ], + matchBaseBranches: [ + "main" + ], + }, + { + "groupName": "Go", + "matchDepNames": [ + "go", + "docker.io/library/golang" + ], + }, + { + // Avoid updating patch releases of golang in go.mod + "enabled": "false", + "matchFiles": [ + "go.mod", + ], + "matchDepNames": [ + "go" + ], + "matchDatasources": [ + "golang-version" + ], + "matchUpdateTypes": [ + "patch" + ], + matchBaseBranches: [ + "main" + ] + }, + ], + "regexManagers": [ + { + "fileMatch": [ + "^\\.github/workflows/[^/]+\\.yaml$", + ], + // This regex manages version strings in GitHub actions workflow files, + // similar to the examples shown here: + // https://docs.renovatebot.com/modules/manager/regex/#advanced-capture + "matchStrings": [ + "# renovate: datasource=(?.*?) depName=(?.*?)\\s+.+version: (?.*)" + ] + }, + ] +} diff --git a/go.mod b/go.mod index 070311a6..47d85103 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/mozillazg/ptcpdump -go 1.21.7 +go 1.21.0 require ( github.com/cilium/ebpf v0.14.0