2021-09-11 15:10:32 +00:00
# GitHub
2019-11-13 18:50:54 +00:00
2023-09-19 11:25:10 +00:00
Woodpecker comes with built-in support for GitHub and GitHub Enterprise.
To use Woodpecker with GitHub the following environment variables should be set for the server component:
2024-01-11 17:43:54 +00:00
```ini
2023-09-19 11:25:10 +00:00
WOODPECKER_GITHUB=true
WOODPECKER_GITHUB_CLIENT=YOUR_GITHUB_CLIENT_ID
WOODPECKER_GITHUB_SECRET=YOUR_GITHUB_CLIENT_SECRET
2019-07-05 13:30:25 +00:00
```
2023-09-25 22:03:37 +00:00
You will get these values from GitHub when you register your OAuth application.
To do so, go to Settings -> Developer Settings -> GitHub Apps -> New Oauth2 App.
:::warning
Do not use a "GitHub App" instead of an Oauth2 app as the former will not work correctly with Woodpecker right now (because user access tokens are not being refreshed automatically)
:::
2019-07-05 13:30:25 +00:00
2023-09-19 11:25:10 +00:00
## App Settings
2019-07-05 13:30:25 +00:00
2023-09-19 11:25:10 +00:00
- Name: An arbitrary name for your App
- Homepage URL: The URL of your Woodpecker instance
- Callback URL: `https://<your-woodpecker-instance>/authorize`
2023-10-31 08:14:09 +00:00
- (optional) Upload the Woodpecker Logo: < https: // avatars . githubusercontent . com / u / 84780935 ? s = 200&v=4 >
2019-07-05 13:30:25 +00:00
2023-09-19 11:25:10 +00:00
## Client Secret Creation
2019-07-05 13:30:25 +00:00
2023-09-19 11:25:10 +00:00
After your App has been created, you can generate a client secret.
Use this one for the `WOODPECKER_GITHUB_SECRET` environment variable.
2023-11-24 15:21:47 +00:00
## Configuration
2023-09-19 11:25:10 +00:00
This is a full list of configuration options. Please note that many of these options use default configuration values that should work for the majority of installations.
2022-03-01 15:09:33 +00:00
2023-11-24 15:21:47 +00:00
### `WOODPECKER_GITHUB`
2022-02-09 19:32:38 +00:00
2023-11-24 15:21:47 +00:00
> Default: `false`
2022-02-09 19:32:38 +00:00
2023-11-24 15:21:47 +00:00
Enables the GitHub driver.
2022-03-01 15:09:33 +00:00
2023-11-24 15:21:47 +00:00
### `WOODPECKER_GITHUB_URL`
2022-03-01 15:09:33 +00:00
2023-11-24 15:21:47 +00:00
> Default: `https://github.com`
2022-02-09 19:32:38 +00:00
2023-11-24 15:21:47 +00:00
Configures the GitHub server address.
2022-02-09 19:32:38 +00:00
2023-11-24 15:21:47 +00:00
### `WOODPECKER_GITHUB_CLIENT`
2022-02-09 19:32:38 +00:00
2023-11-24 15:21:47 +00:00
> Default: empty
Configures the GitHub OAuth client id to authorize access.
### `WOODPECKER_GITHUB_CLIENT_FILE`
> Default: empty
Read the value for `WOODPECKER_GITHUB_CLIENT` from the specified filepath.
### `WOODPECKER_GITHUB_SECRET`
> Default: empty
Configures the GitHub OAuth client secret. This is used to authorize access.
### `WOODPECKER_GITHUB_SECRET_FILE`
> Default: empty
Read the value for `WOODPECKER_GITHUB_SECRET` from the specified filepath.
### `WOODPECKER_GITHUB_MERGE_REF`
> Default: `true`
### `WOODPECKER_GITHUB_SKIP_VERIFY`
> Default: `false`
Configure if SSL verification should be skipped.