Skip to content

Commit 20ba2f2

Browse files
authored
Configure renovate to update app version (#17)
* Configure renovate to update app version * Add CI for renovate * Log more * Specify repository * Avoid user api query * Explicitly set git author * Fix image ref * Enable manager for app version * Explicitly specify config * Update action * Use correct branch * Parse renovate log output * Update log script
1 parent ded430e commit 20ba2f2

File tree

3 files changed

+63
-3
lines changed

3 files changed

+63
-3
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Renovate
2+
on:
3+
push:
4+
5+
jobs:
6+
renovate:
7+
name: Dry Run
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v3.5.3
12+
- name: Renovate Dry Run
13+
uses: renovatebot/github-action@v39.0.1
14+
with:
15+
token: ${{ secrets.GITHUB_TOKEN }}
16+
env-regex: "^(?:RENOVATE_\\w+|LOG_LEVEL|LOG_FORMAT)$"
17+
env:
18+
RENOVATE_DRY_RUN: lookup
19+
RENOVATE_USERNAME: renovate-bot
20+
RENOVATE_GIT_AUTHOR: renovate bot <renovate@example.org>
21+
RENOVATE_REPOSITORIES: ${{ github.repository }}
22+
RENOVATE_BASE_BRANCHES: ${{ github.ref_name }}
23+
RENOVATE_USE_BASE_BRANCH_CONFIG: merge
24+
LOG_LEVEL: debug
25+
LOG_FORMAT: json
26+
RENOVATE_LOG_FILE: /tmp/renovate.log
27+
- name: Show pending updates
28+
uses: actions/github-script@v6
29+
with:
30+
script: |
31+
const fs = require("fs/promises");
32+
const logFile = await fs.readFile("/tmp/renovate.log", { encoding: "utf-8" });
33+
const lines = logFile.split("\n");
34+
for (const line of lines) {
35+
/** @type {{ msg: string, config: Record<string, any> }} */
36+
const log = JSON.parse(line);
37+
if (log.msg === "packageFiles with updates") {
38+
for (const [manager, files] of Object.entries(log.config)) {
39+
console.log(`\n--- MANAGER ${manager}`);
40+
for (const file of files) {
41+
console.log(`In ${file.packageFile}:`);
42+
if (file.deps.some((d) => d.updates.length > 0)) {
43+
for (const dep of file.deps) {
44+
for (const update of dep.updates) {
45+
console.log(
46+
` - ${dep.datasource} "${dep.depName}" from ${dep.currentVersion} to ${update.newVersion}`
47+
);
48+
}
49+
}
50+
} else {
51+
console.log(" No updates");
52+
}
53+
}
54+
}
55+
return;
56+
}
57+
}
58+
59+
console.log("No updates");

charts/netbox/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v2
22
name: netbox
33
version: 4.1.7
4-
# renovate: netbox-community/netbox
4+
# renovate: image=netboxcommunity/netbox
55
appVersion: v3.3.2
66
description: IP address management (IPAM) and data center infrastructure management (DCIM) tool
77
home: https://github.com/chaosdorf/helm-charts/tree/main/charts/netbox

renovate.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
33
"extends": [
4-
"config:base"
4+
"config:base",
5+
"regexManagers:helmChartYamlAppVersions"
56
]
6-
}
7+
}

0 commit comments

Comments
 (0)