Options can be passed using the inputs of this action or the corresponding environment variables.
When both are passed, the input takes precedence over the environment variable.
For the available environment variables, see the Renovate [Self-Hosted Configuration](https://docs.renovatebot.com/self-hosted-configuration/) docs.
Options can be passed using the inputs of this action or the corresponding environment variables. When both are passed, the input takes precedence over the environment variable. For the available environment variables see the Renovate [Self-Hosted Configuration](https://docs.renovatebot.com/self-hosted-configuration/) and [Self-Hosting](https://docs.renovatebot.com/self-hosting/) docs.
### `additional-env-list`
## `configurationFile`
A newline-separated list of environment variable names to pass through to the Renovate container, in addition to those already matched by [`env-regex`](#env-regex).
See [Passing other environment variables](#passing-other-environment-variables) section for more details.
Configuration file to configure Renovate. The supported configurations files can be one of the configuration files listed in the Renovate Docs for [Configuration Options](https://docs.renovatebot.com/configuration-options/) or a JavaScript file that exports a configuration object. For both of these options, an example can be found in the [example](./example) directory.
### `configurationFile`
Configuration file to configure Renovate ("global" config) in JavaScript or JSON format.
It is recommended to not name it one of the repository configuration filenames listed in the Renovate Docs for [Configuration Options](https://docs.renovatebot.com/configuration-options/).
Config examples can be found in the [example](./example) directory.
The configurations that can be done in this file consists of two parts, as listed below.
Refer to the links to the [Renovate Docs](https://docs.renovatebot.com/) for all options.
The configurations that can be done in this file consists of two parts, as listed below. Refer to the links to the [Renovate Docs](https://docs.renovatebot.com/) for all options.
The [`branchPrefix`](https://docs.renovatebot.com/configuration-options/#branchprefix) option is important to configure and should be configured to a value other than the default to prevent interference with e.g. the Renovate GitHub App.
If you want to use this with just the single configuration file, make sure to include the following two configuration lines.
This disables the requirement of a configuration file for the repository and disables onboarding.
If you want to use this with just the single configuration file, make sure to include the following two configuration lines. This disables the requirement of a configuration file for the repository and disables onboarding.
```js
onboarding:false,
requireConfig:'optional',
requireConfig:false,
```
### `docker-cmd-file`
## `token`
Specify a command to run when the image start.
By default the image run
`renovate`.
This option is useful to customize the image before running `renovate`.
It must be an existing executable file on the local system.
It will be mounted to the docker container.
[Generate a personal access token](https://github.com/settings/tokens), with the `repo:public_repo` scope for only public repositories or the `repo` scope for public and private repositories, and add it to _Secrets_ (repository settings) as `RENOVATE_TOKEN`. You can also create a token without a specific scope, which gives read-only access to public repositories, for testing. This token is only used by Renovate, see the [token configuration](https://docs.renovatebot.com/self-hosted-configuration/#token), and gives it access to the repositories. The name of the secret can be anything as long as it matches the argument given to the `token` option.
For example you can create a simple script like this one (let's call it
`renovate-entrypoint.sh`).
```sh
#!/bin/bash
apt update
apt install -y build-essential libpq-dev
runuser -u ubuntu renovate
```
Now use this action
```yml
....
jobs:
renovate:
runs-on:ubuntu-latest
steps:
- name:Checkout
uses:actions/checkout@v7.0.1
- name:Self-hosted Renovate
uses:renovatebot/github-action@v48.0.1
with:
docker-cmd-file:.github/renovate-entrypoint.sh
docker-user:root
token:${{ secrets.RENOVATE_TOKEN }}
```
### `docker-network`
Specify a network to run container in.
You can use `${{ job.container.network }}` to run renovate container [in the same network as other containers for this job](https://docs.github.com/en/actions/learn-github-actions/contexts#job-context),
or set it to `host` to run in the same network as github runner, or specify any custom network.
### `docker-socket-host-path`
Allows the overriding of the host path for the Docker socket that is mounted into the container.
Useful on systems where the host Docker socket is located somewhere other than `/var/run/docker.sock` (the default).
Only applicable when `mount-docker-socket` is true.
### `docker-user`
Specify a user (or user-id) to run docker command.
You can use it with [`docker-cmd-file`](#docker-cmd-file) in order to start the
image as root, do some customization and switch back to a unprivileged user.
### `docker-volumes`
Specify volume mounts. Defaults to `/tmp:/tmp`.
The volume mounts are separated through `;`.
This sample will mount `/tmp:/tmp` and `/foo:/bar`.
```yml
....
jobs:
renovate:
runs-on:ubuntu-latest
steps:
- name:Checkout
uses:actions/checkout@v7.0.1
- name:Self-hosted Renovate
uses:renovatebot/github-action@v48.0.1
with:
token:${{ secrets.RENOVATE_TOKEN }}
docker-volumes:|
/tmp:/tmp ;
/foo:/bar
```
### `env-regex`
Allows to configure the regex to define which environment variables are passed to the renovate container.
See [Passing other environment variables](#passing-other-environment-variables) section for more details.
## `mount-docker-socket`
Default to `false`. If set to `true` the action will mount the Docker socket
inside the renovate container so that the commands can use Docker. Can be useful
for `postUpgradeTasks`'s commands. Also add the user inside the renovate
container to the docker group for socket permissions.
### `token`
[Generate a Personal Access Token (classic)](https://github.com/settings/tokens), with the `repo:public_repo` scope for only public repositories or the `repo` scope for public and private repositories, and add it to _Secrets_ (repository settings) as `RENOVATE_TOKEN`.
You can also create a token without a specific scope, which gives read-only access to public repositories, for testing.
This token is only used by Renovate, see the [token configuration](https://docs.renovatebot.com/self-hosted-configuration/#token), and gives it access to the repositories.
The name of the secret can be anything as long as it matches the argument given to the `token` option.
Fine-grained Personal Access Tokens are now supported, as GitHub has [implemented GraphQL API support for them](https://github.com/github/roadmap/issues/622).
However, some permission gaps may remain (for example, around `Checks` access), so a classic token is still the safer default if you run into authentication or automerge limitations.
If you want to use the `github-actions` manager, you must setup a [special token](#special-token-requirements-when-using-the-github-actions-manager) with some requirements.
> can be also used; however, workflows run on RenovateBot's PRs will need to be [manually approved](https://github.blog/changelog/2026-06-11-bot-created-pull-requests-can-run-workflows-if-approved/).
>
> Additionally, ["Allow GitHub Actions to create and approve pull requests"](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#preventing-github-actions-from-creating-or-approving-pull-requests)
> needs to be enabled on the repository or organisation level.
### `renovate-image`
The Renovate Docker image name to use.
If omitted the action will use the `ghcr.io/renovatebot/renovate:<renovate-version>` Docker image name otherwise.
If a Docker image name is defined, the action will use that name to pull the image.
This sample will use `myproxyhub.domain.com/renovate/renovate:<renovate-version>` image.
If omitted the action will use the [`default version`](./action.yml#L28) Docker tag.
Check [the available tags on Docker Hub](https://hub.docker.com/r/renovate/renovate/tags).
This sample will use `ghcr.io/renovatebot/renovate:45.16.0` image.
```yml
....
jobs:
renovate:
runs-on:ubuntu-latest
steps:
- name:Checkout
uses:actions/checkout@v7.0.1
- name:Self-hosted Renovate
uses:renovatebot/github-action@v48.0.1
with:
renovate-version:45.16.0
token:${{ secrets.RENOVATE_TOKEN }}
```
This sample will use `ghcr.io/renovatebot/renovate:full` image.
```yml
....
jobs:
renovate:
runs-on:ubuntu-latest
steps:
- name:Checkout
uses:actions/checkout@v7.0.1
- name:Self-hosted Renovate
uses:renovatebot/github-action@v48.0.1
with:
renovate-version:full
token:${{ secrets.RENOVATE_TOKEN }}
```
We recommend you pin the version of Renovate to a full version or a full checksum, and use Renovate's regex manager to create PRs to update the pinned version.
See `.github/workflows/build.yml` for an example of how to do this.
Note that the [`GITHUB_TOKEN`](https://help.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token#permissions-for-the-github_token) secret can't be used for authenticating Renovate.
## Example
This example uses a Personal Access Token and will run every 15 minutes.
The Personal Access token is configured as a GitHub secret named `RENOVATE_TOKEN`.
This example uses the [`example/renovate-config.js`](./example/renovate-config.js) file as configuration.
Live examples with more advanced configurations of this action can be found in the following repositories:
This example uses a personal access token and will run every 15 minutes. The personal access token is configured as a GitHub secret named `RENOVATE_TOKEN`. This example uses the [`example/config.js`](./example/config.js) file as configuration.
You can also see a live example of this action in my [github-renovate](https://github.com/vidavidorra/github-renovate) repository, which also includes a more [advanced configuration](https://github.com/vidavidorra/github-renovate/blob/master/src/config.js) for updating GitHub Action workflows.
**Remark** Update the action version to the most current, see [here](https://github.com/renovatebot/github-action/releases/latest) for latest release.
@@ -311,41 +70,31 @@ jobs:
runs-on:ubuntu-latest
steps:
- name:Checkout
uses:actions/checkout@v7.0.1
uses:actions/checkout@v2.0.0
- name:Self-hosted Renovate
uses:renovatebot/github-action@v48.0.1
uses:renovatebot/github-action@v21.30.0
with:
configurationFile:example/renovate-config.js
token:${{ secrets.RENOVATE_TOKEN }}
```
### Example for GitHub Enterprise
## Example with GitHub App
If you want to use the Renovate Action on a GitHub Enterprise instance you have to add the following environment variable:
Instead of using a Personal Access Token (PAT) that is tied to a particular user you can use a [GitHub App](https://docs.github.com/en/developers/apps/building-github-apps) where permissions can be even better tuned. [Create a new app](https://docs.github.com/en/developers/apps/creating-a-github-app) and give it the following permissions:
Store the app ID as a secret with name `APP_ID` and generate a new private key for the app and add it as a secret to the repository as `APP_PEM` in the repository where the action will run from. Note that `APP_PEM` needs to be base64 encoded. You can encode your private key file like this from the terminal:
```bash
cat your_app_key.pem | base64 -w 0&&echo
```
### Example with GitHub App
Instead of using a Personal Access Token (PAT) that is tied to a particular user you can use a [GitHub App](https://docs.github.com/en/developers/apps/building-github-apps) where permissions can be even better tuned.
[Create a new app](https://docs.github.com/en/developers/apps/creating-a-github-app) and configure the app permissions and your `config.js` as described in the [Renovate documentation](https://docs.renovatebot.com/modules/platform/github/#running-as-a-github-app).
Generate and download a new private key for the app, adding the contents of the downloaded `.pem` file to _Secrets_ (repository settings) with the name `private_key` and app ID as a secret with name `app_id`.
Adjust your Renovate configuration file to specify the username of your bot.
From the Github app configuration page, install the app in your account or your organization's account, and configure the repository access.
Going forward we will be using the [`actions/create-github-app-token` action](https://github.com/actions/create-github-app-token) in order to exchange the GitHub App certificate for an access token that Renovate can use.
Going forward we will be using the [machine-learning-apps/actions-app-token](https://github.com/machine-learning-apps/actions-app-token) action in order to exchange the GitHub App certificate for an access token that renovate can use.
Renovate can sign commits when deployed as a GitHub App by utilizing GitHub's API-based commits.
To activate this, ensure that `platformCommit` is set to `enabled` in global config.
If a configuration file is defined, include `platformCommit: enabled` to activate this feature.
For example:
```yaml
- name:Self-hosted Renovate
uses:renovatebot/github-action@v48.0.1
with:
token:'${{ steps.get_token.outputs.token }}'
env:
RENOVATE_PLATFORM_COMMIT:'enabled'
```
## Environment Variables
Environment variables prefixed with `RENOVATE_` are passed through to the Docker container automatically. This prefix is reserved for [Renovate self-hosted configuration](https://docs.renovatebot.com/self-hosted-configuration/), so using it for unrelated credentials can accidentally conflict with a Renovate option.
For custom credentials, use a distinct prefix and add the variable to [`env-regex`](#passing-other-environment-variables).
For example if you wish to pass through some credentials for a [host rule](https://docs.renovatebot.com/configuration-options/#hostrules) to the `config.js` then you should do so like this.
1. In your workflow pass in the environment variable
1. In `example/renovate-config.js` include the hostRules block
```js
module.exports = {
hostRules: [
{
hostType: 'terraform-module',
matchHost: 'app.terraform.io',
token: process.env.CUSTOM_TFE_TOKEN,
},
],
};
```
### User agent
By default, the Action sets [`RENOVATE_USER_AGENT`](https://docs.renovatebot.com/self-hosted-configuration/#useragent) to `Renovate/{{renovateVersion}} (https://github.com/renovatebot/github-action)`, so that operators of registries can identify traffic coming from this Action.
To override it, set the `RENOVATE_USER_AGENT` environment variable on the Action step.
### Passing other environment variables
There are two ways to pass additional variables through to the Renovate container:
1. **Recommended:** use [`additional-env-list`](#additional-env-list) to list the names of the variables you want forwarded. This keeps the action's default `env-regex` in effect, so you'll continue to receive any future additions to the default allow-list. Variable names that are not present in the environment are silently ignored.
2. Override [`env-regex`](#env-regex) with a custom regular expression. This gives you full control but also full ownership: if the action's default pattern changes, your override will not pick up those changes, and a typo in the regex can silently drop variables (including `RENOVATE_*` ones).
Example using `additional-env-list` (recommended):
In some cases, Renovate can update PRs more frequently than you expect. The [repository cache](https://docs.renovatebot.com/self-hosted-configuration/#repositorycache) can help with this issue. You need a few things to persist this cache in GitHub Actions:
1. Enable the `repositoryCache` [option](https://docs.renovatebot.com/self-hosted-configuration/#repositorycache) via env vars or renovate.json.
2. Restore `/tmp/renovate/cache/renovate/repository` before Renovate runs.
3. Save the updated directory under a new cache key after Renovate finishes.
Below is a workflow example with caching.
The primary key includes `github.run_id` and `github.run_attempt`, so each successful run or rerun can save its updated cache. `restore-keys` selects the most recent prior cache. The ownership fix is still required because the restored files are created by the runner but Renovate reads them inside its container as user `12021`.
```yml
name: Renovate
on:
# This lets you dispatch a renovate job with different cache options if you want to reset or disable the cache manually.
workflow_dispatch:
inputs:
repoCache:
description: 'Reset or disable the cache?'
type: choice
default: enabled
options:
- enabled
- disabled
- reset
schedule:
# Run every 30 minutes:
- cron: '0,30 * * * *'
# Adding these as env variables makes it easy to re-use them in different steps and in bash.
env:
# This is the dir renovate provides -- if we set our own directory via cacheDir, we can run into permissions issues.
# It is also possible to cache a higher level of the directory, but it has minimal benefit. While renovate execution
# time gets faster, it also takes longer to upload the cache as it grows bigger.
In case of issues, it's always a good idea to enable debug logging first.
To enable debug logging, add the environment variable `LOG_LEVEL: 'debug'` to the action:
```yml
- name: Self-hosted Renovate
uses: renovatebot/github-action@v48.0.1
with:
configurationFile: example/renovate-config.js
token: ${{ secrets.RENOVATE_TOKEN }}
env:
LOG_LEVEL: 'debug'
```
### Special token requirements when using the `github-actions` manager
If you want to use the `github-actions` [manager](https://docs.renovatebot.com/modules/manager/github-actions/) in Renovate, ensure that the `token` you provide contains the `workflow` scope.
Otherwise, GitHub does not allow Renovate to update workflow files and therefore it will be unable to create update PRs for affected packages (like `actions/checkout` or `renovatebot/github-action` itself).
`Environment variable '${name}' listed in 'additional-env-list' was not found in the parent process environment; it will not be passed to the renovate container.`,
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.