Ruby Pronto&Gitlab合并请求:无内联注释

时间:2020-03-25 09:35:10

标签: ruby gitlab gitlab-ci pronto

pronto与Github结合使用一段时间后,我尝试将其与Gitlab安装结合起来进行安装。

CI流程本身运行正常,但是没有像我期望的那样添加任何合并请求注释。看起来它并没有执行任何与Gitlab相关的操作,但是也没有任何错误消息。

我的配置(相关部分)如下:

stages:
  - security

.shared-variables: &shared-variables
  PRONTO_GITLAB_API_ENDPOINT: "https://gitlab.example.com/api/v4"
  PRONTO_PULL_REQUEST_ID: $CI_MERGE_REQUEST_IID
  # PRONTO_GITLAB_API_PRIVATE_TOKEN is set from within GitLab

brakeman:
  stage: security
  only:
    - merge_requests

  variables:
    <<: *shared-variables
    BUNDLE_GEMFILE: Gemfile-pronto-brakeman

  cache:
    key: brakeman
    paths:
      - .gem

  before_script:
    - export PATH=$GEM_HOME/bin:$PATH
    - |
      cat > $BUNDLE_GEMFILE << EOF
        git_source(:github) { |repo_name| "https://github.com/#{repo_name}.git" }

        gem 'pronto'
        gem 'brakeman'
        # TODO: change back once https://github.com/prontolabs/pronto-brakeman/pull/21 is merged & published
        gem 'pronto-brakeman', github: 'zenom/pronto-brakeman'
      EOF
    -  bundle install --jobs $(nproc)

  script:
    # this part of the pipeline only uses the brakeman runner
    - bundle exec pronto run --exit-code -f gitlab_mr -r brakeman -c origin/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME

bundle-audit:
  stage: security
  only:
    - merge_requests

  variables:
    <<: *shared-variables
    BUNDLE_GEMFILE=Gemfile-pronto-bundler_audit

  before_script:
    - export PATH=$GEM_HOME/bin:$PATH
    - |
      cat > $BUNDLE_GEMFILE << EOF
        git_source(:github) { |repo_name| "https://github.com/#{repo_name}.git" }

        gem 'pronto'
        # Latest changes haven't been published yet
        gem 'bundler-audit', github: 'rubysec/bundler-audit'
        gem 'pronto-bundler_audit'
      EOF
    - gem update --system
    - bundle install --jobs $(nproc)
    - bundle exec bundle-audit update

  script:
    # Note that bundler_audit is fixed to scan `Gemfile.lock`
    - bundle exec pronto run --exit-code -f gitlab_mr -r bundler_audit -c origin/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME

0 个答案:

没有答案