Skip to content

Commit 8e5c628

Browse files
authored
renovate: Add git-refs custom manager for commit SHA tracking (#91)
Add a custom regex manager to track git commit SHAs in Justfiles and YAML workflows. The pattern matches both double-quoted (Justfile) and single-quoted (YAML) strings containing 40-character commit SHAs. Example usage: # renovate: datasource=git-refs depName=https://github.com/org/repo branch=main export VAR := env("VAR", "<40-char-sha>") # Justfile VAR: '<40-char-sha>' # YAML This enables Renovate to automatically update pinned commit references when the tracked branch advances. Assisted-by: OpenCode (Claude Sonnet 4)
1 parent 2c6a467 commit 8e5c628

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

renovate-shared-config.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,21 @@
4747
"matchStrings": [
4848
"# renovate: datasource=(?<datasource>[a-z-]+) depName=(?<depName>[^\\s]+)\\n\\s*VERSION=(?<currentValue>v?\\S+)"
4949
]
50+
},
51+
// Git refs (commit SHA) tracking in Justfiles and YAML workflows
52+
// Justfile example:
53+
// # renovate: datasource=git-refs depName=https://github.com/org/repo branch=main
54+
// export VAR := env("VAR", "0000000000000000000000000000000000000000")
55+
// YAML example:
56+
// # renovate: datasource=git-refs depName=https://github.com/org/repo branch=main
57+
// VAR: '0000000000000000000000000000000000000000'
58+
{
59+
"customType": "regex",
60+
"managerFilePatterns": ["**/Justfile", "**/*.just", "**/*.yml", "**/*.yaml"],
61+
"matchStrings": [
62+
"# renovate: datasource=(?<datasource>git-refs) depName=(?<depName>[^\\s]+) branch=(?<currentValue>[^\\s]+)\\n[^\\n]*\"(?<currentDigest>[a-f0-9]{40})\"",
63+
"# renovate: datasource=(?<datasource>git-refs) depName=(?<depName>[^\\s]+) branch=(?<currentValue>[^\\s]+)\\n[^\\n]*'(?<currentDigest>[a-f0-9]{40})'"
64+
]
5065
}
5166
],
5267
"packageRules": [

0 commit comments

Comments
 (0)