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:
-
Use the
GitSCM option. -
Create standard GitHub credentials (Username with password or SSH key) instead of GitHub App credentials.
-
In the
Credentialsfield, configure your GitHub credentials with an appropriateOwnersetting. -
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
-
CloudBees CI - 2.492.1.3
-
GitHub Branch Source plugin - 1810.v913311241fa_9
-
Git plugin - 5.7.0