Skip to content

Commit c50da4b

Browse files
Merge pull request #51 from dreadnode/ads/eng-1755-dependencies-add-renovate-bot-to-rigging
chore: add renovate bot for deps in rigging
2 parents 7086160 + 32f6ca5 commit c50da4b

2 files changed

Lines changed: 139 additions & 0 deletions

File tree

.github/renovate.json5

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
$schema: "https://docs.renovatebot.com/renovate-schema.json",
3+
extends: [
4+
"config:base",
5+
":disableRateLimiting",
6+
":dependencyDashboard",
7+
":semanticCommits",
8+
":enablePreCommit",
9+
":automergeDigest",
10+
":automergeBranch",
11+
],
12+
dependencyDashboardTitle: "Renovate Dashboard 🤖",
13+
suppressNotifications: ["prIgnoreNotification"],
14+
rebaseWhen: "conflicted",
15+
commitBodyTable: true,
16+
"pre-commit": {
17+
enabled: true,
18+
},
19+
poetry: {
20+
fileMatch: ["pyproject.toml"],
21+
},
22+
pip_requirements: {
23+
fileMatch: [
24+
"requirements-test.txt",
25+
"requirements-composer.txt",
26+
"constraints.txt",
27+
"constraints-test.txt",
28+
],
29+
},
30+
packageRules: [
31+
{
32+
matchManagers: ["poetry", "pip_requirements"],
33+
matchPackagePatterns: ["^pytest"],
34+
groupName: "pytest packages",
35+
groupSlug: "pytest",
36+
separateMinorPatch: true,
37+
},
38+
{
39+
matchManagers: ["poetry", "pip_requirements"],
40+
matchDepTypes: ["python"],
41+
allowedVersions: "^3.9",
42+
enabled: true,
43+
},
44+
{
45+
description: "Auto merge non-major updates",
46+
matchUpdateTypes: ["minor", "patch"],
47+
automerge: true,
48+
automergeType: "pr",
49+
},
50+
],
51+
ignorePaths: [],
52+
}

.github/workflows/renovate.yaml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
---
2+
name: Renovate
3+
on:
4+
# checkov:skip=CKV_GHA_7: "Workflow dispatch inputs are required for manual debugging and configuration"
5+
workflow_dispatch:
6+
inputs:
7+
dryRun:
8+
description: Dry Run
9+
default: "false"
10+
required: false
11+
logLevel:
12+
description: Log Level
13+
default: "debug"
14+
required: false
15+
version:
16+
description: Renovate version
17+
default: latest
18+
required: false
19+
schedule:
20+
# Run every evening at 20:00 UTC (8:00 PM UTC)
21+
- cron: "0 20 * * *"
22+
push:
23+
branches: ["main"]
24+
paths:
25+
- .github/renovate.json5
26+
- .github/renovate/**.json5
27+
28+
permissions:
29+
contents: read
30+
pull-requests: write
31+
issues: write
32+
33+
concurrency:
34+
group: ${{ github.workflow }}-${{ github.run_number || github.ref }}
35+
cancel-in-progress: true
36+
37+
# Retrieve BOT_USER_ID via `curl -s "https://api.github.com/users/${BOT_USERNAME}%5Bbot%5D" | jq .id`
38+
env:
39+
WORKFLOW_DRY_RUN: false
40+
WORKFLOW_LOG_LEVEL: debug
41+
WORKFLOW_VERSION: latest # 37.59.8
42+
RENOVATE_PLATFORM: github
43+
RENOVATE_PLATFORM_COMMIT: true
44+
RENOVATE_ONBOARDING_CONFIG_FILE_NAME: .github/renovate.json5
45+
RENOVATE_AUTODISCOVER: true
46+
RENOVATE_AUTODISCOVER_FILTER: "${{ github.repository }}"
47+
RENOVATE_GIT_AUTHOR: "${{ secrets.BOT_USERNAME }} <${{ secrets.BOT_USER_ID }}+${{ secrets.BOT_USERNAME }}[bot]@users.noreply.github.com>"
48+
49+
jobs:
50+
renovate:
51+
name: Renovate
52+
runs-on: ubuntu-latest
53+
steps:
54+
- name: Generate Token
55+
uses: actions/create-github-app-token@3ff1caaa28b64c9cc276ce0a02e2ff584f3900c5 # v2.0.2
56+
id: app-token
57+
with:
58+
app-id: "${{ secrets.BOT_APP_ID }}"
59+
private-key: "${{ secrets.BOT_APP_PRIVATE_KEY }}"
60+
61+
- name: Checkout
62+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
63+
with:
64+
token: "${{ steps.app-token.outputs.token }}"
65+
66+
- name: Override default config from dispatch variables
67+
run: |
68+
echo "RENOVATE_DRY_RUN=${{ github.event.inputs.dryRun || env.WORKFLOW_DRY_RUN }}" >> "${GITHUB_ENV}"
69+
echo "LOG_LEVEL=${{ github.event.inputs.logLevel || env.WORKFLOW_LOG_LEVEL }}" >> "${GITHUB_ENV}"
70+
71+
- name: Delete old dashboard
72+
run: |
73+
ISSUE_NUMBER=$(gh issue list -S 'Renovate Dashboard 🤖' --json number -q '.[0].number')
74+
if [ "$ISSUE_NUMBER" != "null" ] && [ -n "$ISSUE_NUMBER" ]; then
75+
gh issue close "$ISSUE_NUMBER"
76+
else
77+
echo "No issue found to close."
78+
fi
79+
env:
80+
GITHUB_TOKEN: "${{ steps.app-token.outputs.token }}"
81+
82+
- name: Renovate
83+
uses: renovatebot/github-action@19e3d87179488d6a0cd9da744d37123ea4b338e5 # v41.0.20
84+
with:
85+
configurationFile: "${{ env.RENOVATE_ONBOARDING_CONFIG_FILE_NAME }}"
86+
token: "${{ steps.app-token.outputs.token }}"
87+
renovate-version: "${{ github.event.inputs.version || env.WORKFLOW_VERSION }}"

0 commit comments

Comments
 (0)