woodpecker/docs/versioned_docs/version-3.5/30-administration/10-configuration/12-forges/20-github.md
Robert Kaussow 1c3c3f52ee
Add docs for v3.5 release (#5049)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-04-02 20:39:02 +02:00

2.5 KiB

toc_max_heading_level
2

GitHub

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:

WOODPECKER_GITHUB=true
WOODPECKER_GITHUB_CLIENT=YOUR_GITHUB_CLIENT_ID
WOODPECKER_GITHUB_SECRET=YOUR_GITHUB_CLIENT_SECRET

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) :::

App Settings

Client Secret Creation

After your App has been created, you can generate a client secret. Use this one for the WOODPECKER_GITHUB_SECRET environment variable.

Configuration

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.


GITHUB

  • Name: WOODPECKER_GITHUB
  • Default: false

Enables the GitHub driver.


GITHUB_URL

  • Name: WOODPECKER_GITHUB_URL
  • Default: https://github.com

Configures the GitHub server address.


GITHUB_CLIENT

  • Name: WOODPECKER_GITHUB_CLIENT
  • Default: none

Configures the GitHub OAuth client id to authorize access.


GITHUB_CLIENT_FILE

  • Name: WOODPECKER_GITHUB_CLIENT_FILE
  • Default: none

Read the value for WOODPECKER_GITHUB_CLIENT from the specified filepath.


GITHUB_SECRET

  • Name: WOODPECKER_GITHUB_SECRET
  • Default: none

Configures the GitHub OAuth client secret. This is used to authorize access.


GITHUB_SECRET_FILE

  • Name: WOODPECKER_GITHUB_SECRET_FILE
  • Default: none

Read the value for WOODPECKER_GITHUB_SECRET from the specified filepath.


GITHUB_MERGE_REF

  • Name: WOODPECKER_GITHUB_MERGE_REF
  • Default: true

GITHUB_SKIP_VERIFY

  • Name: WOODPECKER_GITHUB_SKIP_VERIFY
  • Default: false

Configure if SSL verification should be skipped.


GITHUB_PUBLIC_ONLY

  • Name: WOODPECKER_GITHUB_PUBLIC_ONLY
  • Default: false

Configures the GitHub OAuth client to only obtain a token that can manage public repositories.