Skip to content

Commit de8e948

Browse files
nadiamoeNadia Santalla
authored and
Nadia Santalla
committed
chore: use grafana/sm-renovate shared presets and actions
1 parent b3b3754 commit de8e948

File tree

3 files changed

+31
-115
lines changed

3 files changed

+31
-115
lines changed

.github/renovate.json5

+6-70
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,23 @@
11
{
22
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
33
"extends": [
4-
"config:best-practices",
5-
":semanticCommitsDisabled"
4+
"github>grafana/sm-renovate//presets/grafana.json5",
5+
"github>grafana/sm-renovate//presets/synthetic-monitoring.json5",
6+
"github>grafana/sm-renovate//presets/go.json5",
7+
"github>grafana/sm-renovate//presets/grafana-build-tools.json5"
68
],
7-
8-
"branchPrefix": "grafanarenovatebot/",
9-
"commitMessagePrefix": "Chore: ",
10-
"platformCommit": "enabled",
11-
"dependencyDashboard": false,
12-
"forkProcessing": "disabled",
13-
"rebaseWhen": "behind-base-branch",
14-
"prHourlyLimit": 0,
15-
"prConcurrentLimit": 10,
16-
"branchConcurrentLimit": 10,
17-
18-
"enabledManagers": ["custom.regex", "gomod"],
19-
20-
"labels": ["dependencies"],
21-
22-
"gomod": {
23-
"enabled": true
24-
},
25-
26-
"postUpdateOptions": [
27-
"gomodTidyE"
28-
],
29-
309
"packageRules": [
31-
{
32-
"matchManagers": ["gomod"],
33-
"matchUpdateTypes": ["digest"],
34-
"schedule": "before 8am on monday every 2 weeks"
35-
},
36-
{
37-
"matchManagers": ["gomod"],
38-
"matchPackageNames": "github.com/prometheus/*",
39-
"groupName": "prometheus-go"
40-
},
41-
{
42-
"matchPackageNames": "**/renovate",
43-
"extends": ["schedule:weekly"]
44-
},
4510
{
4611
// The default "docker" versioning will try to restrict upgrades to versions that do not change everything after
4712
// a dash (-) for the current tag, as this typically indicates the "flavor" (e.g. postgresql:17.1-alpine will not
4813
// be upgraded to postgresql:17.2-debian).
4914
// This image in particular has lots of dashes and does not follow this convention, so we force "loose"
5015
// versioning which is pretty much an alphabetical sort.
5116
"matchPackageNames": ["ghcr.io/grafana/chromium-swiftshader-alpine"],
52-
"versioning": "loose",
53-
},
17+
"versioning": "loose"
18+
}
5419
],
55-
5620
"customManagers": [
57-
{
58-
"customType": "regex",
59-
"datasourceTemplate": "docker",
60-
"versioningTemplate": "semver",
61-
"registryUrlTemplate": "https://ghcr.io",
62-
"fileMatch": [
63-
"(^|/)Makefile$",
64-
".*\\.jsonnet$",
65-
".*\\.mk$",
66-
"^\\.github/workflows/.*\\.ya?ml$"
67-
],
68-
"matchStrings": [
69-
"\\bghcr\\.io/(?<depName>grafana/grafana-build-tools):(?<currentValue>v\\d+\\.\\d+\\.\\d+)(?:@(?<currentDigest>sha256:[a-f0-9]+))?\\b"
70-
]
71-
},
7221
{
7322
// Update k6 version in Dockerfiles.
7423
"customType": "regex",
@@ -78,19 +27,6 @@
7827
"matchStrings": [
7928
"(?:^|\\n)[ \\t]*K6_VERSION\\s*:=\\s*(?<currentValue>\\S+)[ \\t]*(?:$|\\n)"
8029
]
81-
},
82-
{
83-
// Update renovate version in GHA workflow file.
84-
"customType": "regex",
85-
"depNameTemplate": "ghcr.io/renovatebot/renovate",
86-
"datasourceTemplate": "docker",
87-
"fileMatch": [
88-
"^\\.github/workflows/.*\\.ya?ml$",
89-
],
90-
"matchStrings": [
91-
"renovate-version: (?<currentValue>[^@\\s]+)(?:@(?<currentDigest>\\S+))?",
92-
"RENOVATE_IMAGE=ghcr.io/renovatebot/renovate:(?<currentValue>[^@\\s]+)(?:@(?<currentDigest>\\S+))?"
93-
]
9430
}
9531
]
9632
}

.github/workflows/renovate-validate.yaml

+15-8
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,23 @@ name: Validate renovate config
22
on:
33
pull_request:
44
paths:
5-
- '.github/renovate.*'
5+
# When renovate config changes:
6+
- "renovate.*"
7+
- ".renovate.*"
8+
- ".github/renovate.*"
9+
# Also when renovate version changes:
10+
- ".github/workflows/renovate*"
11+
612
jobs:
7-
validate:
13+
renovate:
14+
permissions:
15+
# Needed for logging into vault.
16+
contents: read
17+
id-token: write
818
runs-on: ubuntu-latest
919
timeout-minutes: 5
1020
steps:
1121
- name: Checkout Code
12-
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
13-
- name: Renovate config validator
14-
run: |
15-
# Renovate updates the line below. Please keep its formatting as it is.
16-
export RENOVATE_IMAGE=ghcr.io/renovatebot/renovate:39.14.1@sha256:65e8c6c295d33569995412053890b983cd01a6c8de643adb4d175889a27a07ed
17-
docker run -i --rm -v "$(realpath .):/repo" -w /repo --entrypoint renovate-config-validator "$RENOVATE_IMAGE" --strict
22+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
23+
- name: Self-hosted renovate
24+
uses: grafana/sm-renovate/actions/renovate-validate@main

.github/workflows/renovate.yaml

+10-37
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,20 @@
1-
name: Renovate
1+
name: Self-hosted Renovate
2+
23
on:
34
schedule:
4-
- cron: "16 */4 * * *"
5+
- cron: "12 */4 * * *"
56
workflow_dispatch:
67

78
jobs:
89
renovate:
910
permissions:
10-
contents: read # needed to read the contents of the repository
11-
id-token: write # needed to create a GitHub App token
11+
# Needed for logging into vault.
12+
contents: read
13+
id-token: write
1214
runs-on: ubuntu-latest
13-
timeout-minutes: 10
15+
timeout-minutes: 5
1416
steps:
1517
- name: Checkout Code
16-
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
17-
18-
- name: retrieve secrets
19-
id: get-secrets
20-
uses: grafana/shared-workflows/actions/get-vault-secrets@7d18a46aafb8b875ed76a0bc98852d74b91e7f91 # v1.0.0
21-
with:
22-
common_secrets: |
23-
GRAFANA_RENOVATE_APP_ID=grafana-renovate-app:app-id
24-
GRAFANA_RENOVATE_PRIVATE_KEY=grafana-renovate-app:private-key
25-
26-
- name: create GitHub app token
27-
id: app-token
28-
# Beware that the token generated here has elevated permissions wrt to
29-
# the ones set in the action. In particular, it will be able to write
30-
# to the repository (e.g. create branches) and create pull requests.
31-
uses: actions/create-github-app-token@v1
32-
with:
33-
app-id: ${{ env.GRAFANA_RENOVATE_APP_ID }}
34-
private-key: ${{ env.GRAFANA_RENOVATE_PRIVATE_KEY }}
35-
owner: ${{ github.repository_owner }}
36-
37-
- name: Self-hosted Renovate
38-
uses: renovatebot/github-action@7743ec9e19ceeb61a3862c5d4131e6710195af11 # v40.3.3
39-
with:
40-
renovate-version: 39.14.1@sha256:65e8c6c295d33569995412053890b983cd01a6c8de643adb4d175889a27a07ed
41-
configurationFile: .github/renovate-app.json
42-
token: "${{ steps.app-token.outputs.token }}"
43-
env:
44-
LOG_LEVEL: debug
45-
RENOVATE_PLATFORM: github
46-
RENOVATE_REPOSITORIES: ${{ github.repository }}
47-
RENOVATE_USERNAME: GrafanaRenovateBot
18+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
19+
- name: Self-hosted renovate
20+
uses: grafana/sm-renovate/actions/renovate@main

0 commit comments

Comments
 (0)