feat(config): add support for regular Renovate config files (#79)

This commit is contained in:
Jeroen de Bruijn 2020-05-11 21:55:07 +02:00 committed by GitHub
parent 3aa72249b9
commit fa9be0537a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 41 additions and 15 deletions

View file

@ -52,6 +52,10 @@ jobs:
e2e:
needs: [cleanup]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
configurationFile: [example/renovate-config.js, example/renovate.json]
steps:
- name: Checkout
uses: actions/checkout@v2.1.0
@ -62,8 +66,9 @@ jobs:
- name: Renovate test
uses: ./
with:
configurationFile: example/renovate-config.js
configurationFile: ${{ matrix.configurationFile }}
token: ${{ secrets.RENOVATE_TOKEN }}
build:
needs: [lint, commitlint, e2e]
runs-on: ubuntu-latest

View file

@ -8,13 +8,11 @@ GitHub Action to run Renovate self-hosted.
- [Badges](#badges)
- [Options](#options)
- [`configurationFile`](#option-configurationFile)
- [`token`](#option-token)
- [`configurationFile`](#configurationfile)
- [`token`](#token)
- [Example](#example)
- [License](#license)
<a name="badges"></a>
## Badges
| Badge | Description | Service |
@ -25,15 +23,13 @@ GitHub Action to run Renovate self-hosted.
| <a href="https://github.com/renovatebot/github-action/actions"><img alt="GitHub workflow status" src="https://img.shields.io/github/workflow/status/renovatebot/github-action/Build?style=flat-square"></a> | Build | GitHub Actions |
| <a href="https://github.com/renovatebot/github-action/actions"><img alt="GitHub workflow status" src="https://img.shields.io/github/workflow/status/renovatebot/github-action/Example?style=flat-square"></a> | Example | GitHub Actions |
<a name="options"></a>
## Options
<a name="option-configurationFile"></a>
## `configurationFile`
Configuration file to configure Renovate. 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 and see the [`example/config.js`](./example/config.js) for an example configuration.
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.
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.
1. [Self-Hosted Configuration Options](https://docs.renovatebot.com/self-hosted-configuration/)
2. [Configuration Options](https://docs.renovatebot.com/configuration-options/)
@ -47,16 +43,12 @@ If you want to use this with just the single configuration file, make sure to in
requireConfig: false,
```
<a name="option-token"></a>
## `token`
[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.
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.
<a name="example"></a>
## 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/config.js`](./example/config.js) file as configuration.
@ -78,6 +70,6 @@ jobs:
- name: Self-hosted Renovate
uses: renovatebot/github-action@v1.0.0
with:
configurationFile: example/config.js
configurationFile: example/renovate-config.js
token: ${{ secrets.RENOVATE_TOKEN }}
```

29
example/renovate.json Normal file
View file

@ -0,0 +1,29 @@
{
"branchPrefix": "test-renovate/",
"dryRun": true,
"gitAuthor": "Renovate Bot <bot@renovateapp.com>",
"logLevel": "debug",
"onboarding": false,
"platform": "github",
"includeForks": true,
"repositories": [
"renovatebot/github-action",
"renovate-tests/cocoapods1",
"renovate-tests/gomod1"
],
"packageRules": [
{
"description": "lockFileMaintenance",
"updateTypes": [
"pin",
"digest",
"patch",
"minor",
"major",
"lockFileMaintenance"
],
"masterIssueApproval": false,
"stabilityDays": 0
}
]
}