mirror of
https://github.com/renovatebot/github-action.git
synced 2025-12-16 00:42:35 +00:00
docs: Clarify the README (#641)
Clarify the README Added an explanation on how to use environment variables and use custom host rules Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
This commit is contained in:
parent
a0ed9c205e
commit
7c1c4555bc
1 changed files with 40 additions and 1 deletions
41
README.md
41
README.md
|
|
@ -11,6 +11,7 @@ GitHub Action to run Renovate self-hosted.
|
|||
- [`configurationFile`](#configurationfile)
|
||||
- [`token`](#token)
|
||||
- [Example](#example)
|
||||
- [Environment Variables](#environment-variables)
|
||||
- [Troubleshooting](#troubleshooting)
|
||||
- [Debug Logging](#debug-logging)
|
||||
- [Special token requirements when using the `github-actions` manager](#special-token-requirements-when-using-the-github-actions-manager)
|
||||
|
|
@ -82,7 +83,7 @@ jobs:
|
|||
token: ${{ secrets.RENOVATE_TOKEN }}
|
||||
```
|
||||
|
||||
## Example with GitHub App
|
||||
### 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).
|
||||
|
||||
|
|
@ -126,6 +127,44 @@ jobs:
|
|||
token: 'x-access-token:${{ steps.get_token.outputs.app_token }}'
|
||||
```
|
||||
|
||||
## Environment Variables
|
||||
|
||||
If you wish to pass through environment variables through to the Docker Run that powers this action you need to prefix the environment variable with `RENOVATE_`.
|
||||
|
||||
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
|
||||
```yml
|
||||
....
|
||||
jobs:
|
||||
renovate:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2.0.0
|
||||
- name: Self-hosted Renovate
|
||||
uses: renovatebot/github-action@v32.118.0
|
||||
with:
|
||||
configurationFile: example/renovate-config.js
|
||||
token: ${{ secrets.RENOVATE_TOKEN }}
|
||||
env:
|
||||
RENOVATE_TFE_TOKEN: ${{ secrets.MY_TFE_TOKEN }}
|
||||
```
|
||||
|
||||
2. In `example/renovate-config.js` include the hostRules block
|
||||
```js
|
||||
|
||||
module.exports = {
|
||||
hostRules: [
|
||||
{
|
||||
hostType: 'terraform-module',
|
||||
matchHost: 'app.terraform.io',
|
||||
token: proccess.env.RENOVATE_TFE_TOKEN
|
||||
}
|
||||
]
|
||||
};
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Debug logging
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue