jenkins-infra / repository-permissions-updater

Artifactory permissions synchronization tool and data set
79 stars 1.05k forks source link

repository not found issue by this jenkins plugins - Pipeline GitHub Notify Step Plugin Version49.vf37bf92d2bc8 #4140

Closed Jaideep1997 closed 1 month ago

Jaideep1997 commented 1 month ago

Reproduction steps

I wanted to notify the github after my pipeline will complete execution , but after using same credentials , in the post steps there were getting error - repository not found with this account . the written pipeline is - pipeline { agent any

environment {
    GITHUB_REPO = 'Jaideep1997/ai-chatbot'
    GIT_CREDENTIALS_ID = 'github-creds'
}

stages {
    stage('Checkout Code') {
        steps {
            // Explicitly check out the code
            git branch: 'main', credentialsId: GIT_CREDENTIALS_ID, url: "https://github.com/${GITHUB_REPO}.git"
        }
    }

    stage('Test GitHub Notify') {
        steps {
            script {
                // Send GitHub notification
                // def commitSHA = sh(script: 'git rev-parse HEAD', returnStdout: true).trim() // Get the current commit SHA
                githubNotify(
                    context: 'Test',
                    status: 'SUCCESS',
                    description: 'Testing GitHub Notify',
                    repo: GITHUB_REPO,
                    credentialsId: GIT_CREDENTIALS_ID,
                    account: 'Jaideep1997',
                    // sha: commitSHA // Use the retrieved commit SHA
                )
            }
        }
    }
}

post {
    always {
        echo "Notification attempt made for commit SHA: ${commitSHA}"
    }
}

}

Expected Results

it will show the notifications in github about the pipeline commit status .

Actual Results

Started by user unknown or anonymous [Pipeline] Start of Pipeline [Pipeline] node Running on Jenkins in /var/jenkins_home/workspace/github-test-notify [Pipeline] { [Pipeline] stage [Pipeline] { (Checkout Code) [Pipeline] checkout Selected Git installation does not exist. Using Default The recommended git tool is: NONE using credential github-new-creds

git rev-parse --resolve-git-dir /var/jenkins_home/workspace/github-test-notify/.git # timeout=10 Fetching changes from the remote Git repository git config remote.origin.url https://github.com/Jaideep1997/ai-chatbot.git # timeout=10 Fetching upstream changes from https://github.com/Jaideep1997/ai-chatbot.git git --version # timeout=10 git --version # 'git version 2.39.5' using GIT_ASKPASS to set credentials github-new-creds git fetch --tags --force --progress -- https://github.com/Jaideep1997/ai-chatbot.git +refs/heads/:refs/remotes/origin/ # timeout=10 git rev-parse refs/remotes/origin/main^{commit} # timeout=10 Checking out Revision 68d2e3d59ebdf230c7e5196c9f0953106c352a6b (refs/remotes/origin/main) git config core.sparsecheckout # timeout=10 git checkout -f 68d2e3d59ebdf230c7e5196c9f0953106c352a6b # timeout=10 Commit message: "Update README.md" git rev-list --no-walk 68d2e3d59ebdf230c7e5196c9f0953106c352a6b # timeout=10 [Pipeline] } [Pipeline] // stage [Pipeline] stage [Pipeline] { (Retrieve Commit SHA) [Pipeline] script [Pipeline] { [Pipeline] sh

  • git rev-parse HEAD [Pipeline] echo Current commit SHA: 68d2e3d59ebdf230c7e5196c9f0953106c352a6b [Pipeline] } [Pipeline] // script [Pipeline] } [Pipeline] // stage [Pipeline] stage [Pipeline] { (Test GitHub Notify) [Pipeline] script [Pipeline] { [Pipeline] githubNotify [Pipeline] echo Failed to send GitHub notification: The specified repository does not exist for the specified account [Pipeline] } [Pipeline] // script [Pipeline] } [Pipeline] // stage [Pipeline] stage [Pipeline] { (Declarative: Post Actions) [Pipeline] echo Notification attempt made for repository: Jaideep1997/ai-chatbot [Pipeline] echo The pipeline has finished with failure. [Pipeline] } [Pipeline] // stage [Pipeline] } [Pipeline] // node [Pipeline] End of Pipeline Finished: FAILURE

Anything else?

But you can see my git clone is done successfully , if creds were wrong , then clone was not happened , even in my api token and webhook also i have connected with full permission. please help me to sort .

MarkEWaite commented 1 month ago

This is the wrong place to ask for help using Jenkins. Please use https://community.jenkins.io or the Jenkins user mailing list or the Jenkins chat channels