From 2144c8bd40d0c024404183e63cf5859370f95fe1 Mon Sep 17 00:00:00 2001 From: Mathieu Kniewallner Date: Fri, 20 Sep 2024 21:58:40 +0200 Subject: [PATCH] chore(renovate): update GitHub Actions major versions in docs (#7584) ## Summary Originally wanted to update the reference to `astral-sh/setup-uv` in https://docs.astral.sh/uv/guides/integration/github/, but thought it could be nice to automate those updates through Renovate. The custom manager will look for any major version GitHub Action reference in any Markdown file in `docs` directory, and raise a PR to update it. Possible improvements: - We could separate those updates from updating the actions updates for uv's own GitHub Actions workflow, which would end up raising 2 different PRs instead of grouping them (example of the current behaviour without this improvement in https://github.com/mkniewallner/mkv-playground/pull/4 where we update the doc reference at the same time as a real dependency usage in a workflow). - ~Should the PRs be raised immediately, to handle the update as soon as possible, instead of waiting for the regular weekly Monday schedule? This would ensure that `astral-sh/setup-uv` references are handled as early as possible.~ done in https://github.com/astral-sh/uv/pull/7584/commits/6af7f4575071091b337a9fd3f24bc4459923f2a2 ## Test Plan I've tested that with https://github.com/mkniewallner/mkv-playground/blob/00ddfb69003843ad57d05f9ef036e655aaf765d7/renovate.json5 and https://github.com/mkniewallner/mkv-playground/blob/00ddfb69003843ad57d05f9ef036e655aaf765d7/docs/integeration/foo.md, where Renovate raised 2 PRs: - https://github.com/mkniewallner/mkv-playground/pull/13 - https://github.com/mkniewallner/mkv-playground/pull/4 --------- Co-authored-by: Zanie Blue --- .github/renovate.json5 | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/renovate.json5 b/.github/renovate.json5 index 1fc97b390..d7d8d9d35 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -25,6 +25,14 @@ matchManagers: ["cargo"], enabled: false, }, + { + // Create dedicated branches to update references to dependencies in the documentation. + matchPaths: ["docs/**/*.md"], + commitMessageTopic: "documentation references to {{{depName}}}", + semanticCommitType: "docs", + semanticCommitScope: null, + additionalBranchPrefix: "docs-", + }, { // Group upload/download artifact updates, the versions are dependent groupName: "Artifact GitHub Actions dependencies", @@ -64,6 +72,18 @@ enabled: false, }, ], + customManagers: [ + // Update major GitHub actions references in documentation. + { + customType: "regex", + fileMatch: ["^docs/.*\\.md$"], + matchStrings: [ + "\\suses: (?[\\w-]+/[\\w-]+)(?/.*)?@(?.+?)\\s", + ], + datasourceTemplate: "github-tags", + versioningTemplate: "regex:^v(?\\d+)$", + }, + ], vulnerabilityAlerts: { commitMessageSuffix: "", labels: ["internal", "security"],