I cannot use GitHub App credentials when using Custom Script for Jenkinsfile discovery

Last Reviewed:2026-01-05()
2 minute readKnowledge base

Issue

When configuring an Organization Folder, Multibranch Pipeline, or Shared Library to use Custom Script for Jenkinsfile discovery, only the Git SCM option appears in the dropdown menu, not the GitHub SCM option.

This prevents using GitHub App credentials, which are only supported by the GitHub SCM option. The Git SCM option requires configuring credentials with an Owner field, making it difficult to manage GitHub App credentials for multiple GitHub organizations.

Explanation

The GitHub SCM option provided by the GitHub Branch Source plugin is designed to work with standard Organization Folder, Multibranch Pipeline, and Shared Library configurations.

When using Custom Script to define how Jenkins discovers and processes the Jenkinsfile, the plugin architecture limits the available SCM options to Git only.

GitHub App credentials are specifically designed to work with the GitHub SCM option and are not compatible with the standard Git SCM option. This creates a limitation when trying to use GitHub App authentication with custom script configurations.

Resolution

No permanent fix is available. This is a known limitation of the GitHub Branch Source plugin architecture when using Custom Script for pipeline definitions.

Workaround

When using Custom Script with GitHub repositories:

  1. Use the Git SCM option.

  2. Create standard GitHub credentials (Username with password or SSH key) instead of GitHub App credentials.

  3. In the Credentials field, configure your GitHub credentials with an appropriate Owner setting.

  4. For multiple GitHub organizations, create separate credentials for each organization with descriptive names to distinguish them.

This workaround does not provide GitHub App authentication when using Custom Script for Jenkinsfile discovery.

Tested product/plugin versions

This article is part of our Knowledge Base and is provided for guidance-based purposes only. The solutions or workarounds described here are not officially supported by CloudBees and may not be applicable in all environments. Use at your own discretion, and test changes in a safe environment before applying them to production systems.