Skip to content

Commit b892bd7

Browse files
committed
feat(dev): add renovate workflow
1 parent 3fff6dc commit b892bd7

2 files changed

Lines changed: 92 additions & 21 deletions

File tree

.github/workflows/renovate.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: Renovate
2+
3+
# Org-wide self-hosted Renovate for the AtvikSecurity organisation.
4+
#
5+
# A single workflow, living in the org `.github` repo, runs Renovate across
6+
# EVERY repo the `atvik-renovate` GitHub App is installed on (autodiscover).
7+
# It replaces the old per-repo Renovate workflows (e.g. the one that used to
8+
# live in tyrfing/.github/workflows/renovate.yml).
9+
#
10+
# Dependency policy is NOT defined here. Each repo opts in with a one-line
11+
# `extends` pointing at the shared preset library:
12+
# { "extends": ["github>AtvikSecurity/renovate-config"] }
13+
# New repos get that line injected automatically via RENOVATE_ONBOARDING_CONFIG
14+
# below (Renovate opens an onboarding PR). See AtvikSecurity/renovate-config.
15+
16+
on:
17+
schedule:
18+
# Hosted Renovate reacts to webhooks plus a ~hourly poll. A 4-hourly cron
19+
# keeps a similar cadence org-wide; lower it if dependency churn is too high.
20+
- cron: "0 */4 * * *"
21+
workflow_dispatch:
22+
inputs:
23+
logLevel:
24+
description: "Renovate log level"
25+
type: choice
26+
default: info
27+
options: [debug, info, warn, error]
28+
dryRun:
29+
description: "Dry-run mode (no PRs / branches / issues written)"
30+
type: choice
31+
default: disabled
32+
options: [disabled, lookup, extract, full]
33+
autodiscoverFilter:
34+
description: "Autodiscover filter (repo glob under the org, e.g. tyrfing or *)"
35+
type: string
36+
default: "*"
37+
push:
38+
branches: [main]
39+
paths:
40+
- ".github/workflows/renovate.yml"
41+
42+
# Renovate authenticates as the `atvik-renovate` GitHub App (App ID 3703588).
43+
# We mint a short-lived installation token via actions/create-github-app-token
44+
# from the RENOVATE_APP_ID / RENOVATE_APP_PRIVATE_KEY secrets, scoped to the
45+
# whole org (owner: ...) so autodiscover can reach every installed repo.
46+
# Commits authored by an App show as "Verified" automatically.
47+
permissions:
48+
contents: read
49+
50+
concurrency:
51+
group: renovate
52+
cancel-in-progress: false
53+
54+
jobs:
55+
renovate:
56+
runs-on: [duck-runner-small]
57+
steps:
58+
- name: Checkout
59+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
60+
with:
61+
persist-credentials: false
62+
63+
- name: Mint GitHub App installation token
64+
id: app-token
65+
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3
66+
with:
67+
app-id: ${{ secrets.RENOVATE_APP_ID }}
68+
private-key: ${{ secrets.RENOVATE_APP_PRIVATE_KEY }}
69+
# Scope the token to the whole org, not just this repo, so
70+
# autodiscover can enumerate and write to every installed repo.
71+
owner: ${{ github.repository_owner }}
72+
73+
- name: Run Renovate
74+
uses: renovatebot/github-action@693b9ef15eec82123529a37c782242f091365961 # v46.1.14
75+
env:
76+
LOG_LEVEL: ${{ inputs.logLevel || 'info' }}
77+
RENOVATE_PLATFORM: github
78+
# Discover every repo the App is installed on, restricted to this org.
79+
RENOVATE_AUTODISCOVER: "true"
80+
RENOVATE_AUTODISCOVER_FILTER: ${{ github.repository_owner }}/${{ inputs.autodiscoverFilter || '*' }}
81+
# New repos onboard themselves by extending the shared preset library.
82+
RENOVATE_ONBOARDING_CONFIG: '{"$schema":"https://docs.renovatebot.com/renovate-schema.json","extends":["github>AtvikSecurity/renovate-config"]}'
83+
# Commit as the App so signatures show as "Verified". The numeric
84+
# prefix is the App's bot user ID; GitHub renders this as the App's
85+
# bot account regardless of slug changes.
86+
RENOVATE_GIT_AUTHOR: "atvik-renovate[bot] <284408317+atvik-renovate[bot]@users.noreply.github.com>"
87+
RENOVATE_USERNAME: "atvik-renovate[bot]"
88+
# Empty when "disabled" is selected; Renovate treats unset as "not a dry run".
89+
RENOVATE_DRY_RUN: ${{ (inputs.dryRun != '' && inputs.dryRun != 'disabled') && inputs.dryRun || '' }}
90+
with:
91+
token: ${{ steps.app-token.outputs.token }}

renovate.json

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,4 @@
11
{
22
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3-
"dependencyDashboard": true,
4-
"prConcurrentLimit": 0,
5-
"prHourlyLimit": 40,
6-
"rebaseWhen": "conflicted",
7-
"labels": [
8-
"Kind/Dependency"
9-
],
10-
"lockFileMaintenance": {
11-
"enabled": true,
12-
"schedule": ["before 5am on monday"]
13-
},
14-
"packageRules": [
15-
{
16-
"matchUpdateTypes": ["lockFileMaintenance"],
17-
"automerge": true
18-
},
19-
{
20-
"matchUpdateTypes": ["minor", "patch", "pin", "digest"],
21-
"minimumReleaseAge": "3 days"
22-
}
23-
]
3+
"extends": ["github>AtvikSecurity/renovate-config"]
244
}

0 commit comments

Comments
 (0)