jenkinsci / jenkinsci/git-client-plugin

[JENKINS-72766] Declarative Pipeline implicit checkout fails with GitHub app credentials

Open
#1,678 8 comments 0 reactions 0 assignees View on GitHub
component:git-client-plugin imported-jira-issue priority:major resolution:unresolved
Dominant language
Java
Stars
152
Forks
402
Avg merge
6h 47m
Merged PRs (30d)
4

Description

I uploaded the log that shows that I configured the github app as mentioned in the docs but the declarative checkout doesn't work, all other features work. I got it working by manually configuring GitSCM but it's a bad experience after doing so much setup work for the Github app. 

How I fixed it: 

options {

skipDefaultCheckout true

}

stages {

stage('Checkout') {

steps {

checkout([

$class: 'GitSCM',

branches: [[name: '*/main']],

doGenerateSubmoduleConfigurations: false,

extensions: [],

submoduleCfg: [],

userRemoteConfigs: [[

credentialsId: 'ssh-github',

url: 'git@​github.com:rootitnow/rootstrap.git'

]]

])

}

}

---
Originally reported by tanguille, imported from: Declarative Pipeline implicit checkout fails with GitHub app credentials


  • status: Open
  • priority: Major
  • component(s): git-client-plugin
  • resolution: Unresolved
  • votes: 1
  • watchers: 4
  • imported: 20251211-071809

Raw content of original issue

I uploaded the log that shows that I configured the github app as mentioned in the docs but the declarative checkout doesn't work, all other features work. I got it working by manually configuring GitSCM but it's a bad experience after doing so much setup work for the Github app. 

How I fixed it: 
options {
skipDefaultCheckout true
}

stages {
stage('Checkout') {
steps {
checkout([
$class: 'GitSCM',
branches: [[name: '*/main']],
doGenerateSubmoduleConfigurations: false,
extensions: [],
submoduleCfg: [],
userRemoteConfigs: [[
credentialsId: 'ssh-github',
url: 'git@github.com:rootitnow/rootstrap.git'
]]
])
}
}

  • environment: All latest version as of writing. Controller runs on truenas scale.

1 attachment

- [image_2024-02-26_142535469.png](https://issues.jenkins.io/secure/attachment/62139/image_2024-02-26_142535469.png)
> ![image_2024-02-26_142535469.png](https://issues.jenkins.io/secure/attachment/62139/image_2024-02-26_142535469.png)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.