首页 > 解决方案 > 从 Github Action 触发 Jenkins webhook

问题描述

我正在尝试通过运行curl命令从 Github Action 触发 Jenkins webhook,但出现 SSL 错误。我怎样才能解决这个问题?我尝试--insecure在命令中添加标志,但仍然不行。这是它的样子

name: jenkins-trigger

on:
    repository_dispatch:
        types:
            - external-ci-success

jobs:
    build:
        name: build
        runs-on: ubuntu-latest
        steps:
            - name: Trigger Jenkins
              run: |
                  curl -X POST https://jenkins.jx.<myhost>/ghprbhook/ \
                      -H "content-type: application/json" \
                      -H "User-Agent: GitHub-Hookshot/5465ee1" \
                      -H "X-GitHub-Hook-ID: 232" \
                      -H "X-GitHub-Hook-Installation-Target-ID: 123213" \
                      -H "X-GitHub-Hook-Installation-Target-Type: repository" \
                      --data '{"pull_request":{"sha": "xxx"}}'


错误curl: (60) SSL certificate problem: unable to get local issuer certificate

当我添加--insecure我得到这个错误:curl: (56) OpenSSL SSL_read: error:14094412:SSL routines:ssl3_read_bytes:sslv3 alert bad certificate, errno 0

标签: jenkinscurlgithub-actions

解决方案


推荐阅读