config.json
)
default.json
)
This guide explains how to integrate RenovateBot with a self-hosted GitHub Actions workflow for automated dependency management, with configurations for custom setups and secure secrets management using AWS Secrets Manager.
renovatebot-github-actions.yml
This file configures a GitHub Actions workflow that integrates RenovateBot for automated dependency management.
name: RenovateBot
on:
schedule:
- cron: "0 */4 * * *" # Runs every 4 hours
workflow_dispatch: # Manual trigger option from GitHub UI
jobs:
renovate:
runs-on:
- self-hosted
- x64
- type: large
- env: ops-prod
steps:
- name: Checkout Repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@ececac1a45f3b08a01d2dd070d28d111c5fe6722 # v4.1.0
with:
role-to-assume: arn:aws:iam::<aws-account-id>:role/<iam-role>
aws-region: <aws-region>
role-duration-seconds: 900
- name: Get Secrets
uses: aws-actions/aws-secretsmanager-get-secrets@fbd65ea98e018858715f591f03b251f02b2316cb # v2.0.8
with:
secret-ids: |
GITHUB_TOKEN,/cicd/common/github_cloud_repo_access
GITHUB_GPG_KEY,/cicd/common/github_gpg_key
- name: Add Secrets to Config
run: |
sed -i 's/%GITHUB_TOKEN%/$/g' config.json
git config --global \
url."https://oauth2:@github.com/".insteadOf \
"https://github.com/"
- name: Self-hosted Renovate
uses: renovatebot/github-action@v40.3.4
with:
configurationFile: config.json
env:
LOG_LEVEL: debug
RENOVATE_GIT_AUTHOR: <Name> <<your bot email>> # Update with bot's email
RENOVATE_ONBOARDING: false
RENOVATE_TOKEN: $
RENOVATE_GIT_PRIVATE_KEY: $
cron
), and it can be manually triggered (workflow_dispatch
).config.json
file.config.json
)config.json
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"endpoint": "https://api.github.com/",
"prHourlyLimit": 2,
"allowedPostUpgradeCommands": [
],
"repositories": [
"<your org>/my-repo1",
"<your org>/my-repo2"
],
"hostRules": [
{
"hostType": "github",
"matchHost": "github.com",
"token": "%GITHUB_TOKEN%"
},
]
}
$schema
:
endpoint
:
prHourlyLimit
:
2
in this example.allowedPostUpgradeCommands
:
repositories
:
hostRules
:
default.json
)default.json
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"baseBranches": [
"main"
],
"extends": [
"config:base",
":rebaseStalePrs",
":semanticCommits",
":semanticCommitScope(deps)"
],
"reviewers": [
"@<your org>/<team name>"
],
"labels": [
"Dependencies",
"Renovate"
],
"customManagers": [
{
"customType": "regex",
"fileMatch": [
"^*\\.tf$"
],
"matchStrings": [
"required_version\\s=\\s\">= (?<currentValue>.*?)\""
],
"depNameTemplate": "opentofu/opentofu",
"datasourceTemplate": "github-releases"
},
{
"fileMatch": [
"^*\\.yml$",
"^*\\.yaml$"
],
"matchStrings": [
"# renovate: datasource=(?<datasource>\\S+) depName=(?<depName>\\S+) registryUrl=(?<registryUrl>\\S+)( extractVersion=(?<extractVersion>.+?))?( versioning=(?<versioning>.*?))?\\n.*?version: (?<currentValue>.*)?\\s"
],
"versioningTemplate": "}semver"
},
{
"fileMatch": [
"(^|/)*\\.hcl$"
],
"matchStrings": [
"# renovate: datasource=(?<datasource>\\S+) depName=(?<depName>\\S+) registryUrl=(?<registryUrl>\\S+)( extractVersion=(?<extractVersion>.+?))?( versioning=(?<versioning>.*?))?\\n.*?version( = \"(?<currentValue>.*)\")?\\s"
],
"versioningTemplate": "}semver"
},
{
"fileMatch": [
"^*\\.yml$",
"^*\\.yaml$"
],
"matchStrings": [
"(?<depName>[^\\s=]+)==(?<currentValue>.*?[^\\s]+)"
],
"datasourceTemplate": "pypi"
},
{
"fileMatch": [
"Dockerfile$"
],
"matchStrings": [
"# renovate: datasource=(?<datasource>\\S+) depName=(?<depName>\\S+) registryUrl=(?<registryUrl>\\S+)( extractVersion=(?<extractVersion>.+
?))?( versioning=(?<versioning>.*?))?\\n.*?version: (?<currentValue>.*)?\\s"
],
"versioningTemplate": "}semver"
}
]
}
baseBranches
:
main
branch (adjustable as needed).extends
:
reviewers
:
labels
:
customManagers
:
.tf
), YAML (.yml
/.yaml
), and HCL (.hcl
).