Jenkins 组织文件夹扫描未检测到存储库

问题描述

Jenkins Scan Organization Folder Log 看起来像这样:

Started by user Obay Abdelagdir
[Thu Dec 31 16:45:21 UTC 2020] Starting organization scan...
[Thu Dec 31 16:45:21 UTC 2020] Updating actions...
Looking up details of my-org-name...
Organization URL: https://github.com/my-org-name
[Thu Dec 31 16:45:22 UTC 2020] Consulting GitHub Organization
Connecting to https://api.github.com using 94421/****** (Github App,necessary for publishing checks)
Looking up repositories of organization my-org-name
0 repositories were processed
[Thu Dec 31 16:45:23 UTC 2020] Finished organization scan. Scan took 1.3 sec
Finished: SUCCESS

Jenkins“Github 组织文件夹”详细信息: 我尝试按照说明操作 here,但没有向组织安装“Github App”(安装在用户身上),我忽略了 Configuration as Code Plugin 部分。 >

Github 应用详情: “Github 应用程序”是使用普通 github 用户 创建的,它安装在对该组织具有所有者权限的用户身上。因为我不能直接安装在组织上。 编辑:我能够将应用的所有权转让给组织并安装它,但同样的问题仍然存在。

我的问题: 它在 0 repositories were processed 上面的日志中说。但是我在组织中有一个分支,它有一个名为 .jenkinsfile文件(是的,我将它添加到了“项目识别器”),内容如下:

pipeline {
  stages {
    stage('Static Code Analysis') {
      parallel {
        stage('Pylint') {
          agent {
            label "pylint"
          }
          steps {
            sh "pylint --exit-zero --load-plugins=pylint_odoo 0-e odoolint --rcfile=./.pylintrc * > pylint.log"
          }
        }
      }
    }
  }
}

一个问题是 github 检查不起作用,它在构建日志中提供以下内容

[GitHub Checks] Failed Publishing GitHub checks: org.kohsuke.github.GHFileNotFoundException: https://api.github.com/repos/my-org-name/my-repo {"message":"Not Found","documentation_url":"https://docs.github.com/rest/reference/repos#get-a-repository"}
[GitHub Checks] Failed Publishing GitHub checks: org.kohsuke.github.GHFileNotFoundException: https://api.github.com/repos/my-org-name/my-repo {"message":"Not Found","documentation_url":"https://docs.github.com/rest/reference/repos#get-a-repository"}
Finished: SUCCESS

解决方法

回答我自己的问题。

必须在组织上安装 github 应用程序。 最好的(也许是唯一的)方法如下:

  1. 使用您的普通用户帐户登录
  2. 打开组织网址,https://github.com/YOUR-ORG-NAME
  3. 打开 Settings 标签,点击 Developer settings
  4. Developer settings下应该有两个选项OAuth AppsGithub Apps,点击Github Apps
  5. 然后按照插件文档中的说明正常操作。
  6. 最后确保在组织中安装该应用。

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...