WIP Renovate の custom datasource
#Renovate
ネイティブの https://docs.renovatebot.com/modules/datasource/github-releases/ は release tag のコミットハッシュを digest として扱う
https://github.com/renovatebot/renovate/blob/298f0e60133736e221701e5239be60ed618b4c15/lib/modules/datasource/github-releases/index.ts#L37-L46
ネイティブの https://docs.renovatebot.com/modules/datasource/github-release-attachments/ は
code:transoformTemplate.jsonata
{
"releases": $map($, function($v) {
{
"version": $v.name,
"sourceUrl":"https://github.com/actions/runner",
"changelogUrl":$join(["https://github.com/actions/runner/releases/tag/",$v.tag_name]),
"releaseTimestamp": $v.published_at,
"digest": $substringAfter($string($v.assetsname ~> /actions-runner-linux-x64-.*\.tar\.gz/.digest), "sha256:"),
"isStable": $not($v.draft)
}
}),
"sourceUrl": "https://github.com/actions/runner",
"homepage": "https://github.com/actions/runner",
"changelogUrl": "https://github.com/actions/runner/releases"
}
https://try.jsonata.org/MlQiRxzuC
code:bash
pbpaste | sed 's/actions\/runner/{{packageName}}/g' | jq -sR
code:json
{
"customDatasources": {
"actions": {
"defaultRegistryUrlTemplate": "https://api.github.com/repos/{{packageName}}/releases",
"transformTemplates": [
"{\n \"releases\": $map($, function($v) {\n {\n \"version\": $v.name,\n \"sourceUrl\":\"https://github.com/{{packageName}}\",\n \"changelogUrl\":$join([\"https://github.com/{{packageName}}/releases/tag/\",$v.tag_name]),\n \"releaseTimestamp\": $v.published_at,\n \"digest\": $substringAfter($string($v.assetsname ~> /actions-runner-linux-x64-.*\\.tar\\.gz/.digest), \"sha256:\"),\n \"isStable\": $not($v.draft)\n }\n }),\n \"sourceUrl\": \"https://github.com/{{packageName}}\",\n \"homepage\": \"https://github.com/{{packageName}}\",\n \"changelogUrl\": \"https://github.com/{{packageName}}/releases\"\n}"
]
}
}
}