开发者社区 > 云效DevOps > 正文

云效通用Git写的是仅支持代码提交触发流水线,为啥在代码合并的时候也触发了?

云效通用Git写的是仅支持代码提交触发流水线,为啥在代码合并的时候也触发了?59bd276bc81486068c66dafb0575167b.png
457f11cc4ab8e39d42a471e4237623e4.png
Response body:
{"object":true,"successful":true}
Response headers:
Date: Sun, 08 Oct 2023 08:13:12 GMT
Content-Type: application/json;charset=UTF-8
Content-Length: 33
Connection: close
Server: Tengine
X-Application-Context: aone-flow-engine:cloudonline:7001
Eagleeye-Traceid-2nd: 0bc152af16967527920128313eae66
Eagleeye-Traceid: 0bc152af16967527920128313eae66
Timing-Allow-Origin: *
Request headers:
Content-Type: application/json
User-Agent: GitLab/13.7.3
X-Gitlab-Event: Merge Request Hook
Request body:
{
"object_kind": "merge_request",
"event_type": "merge_request",
"user": {
"name": "凡衣",
"username": "fanyi10",
"avatar_url": "https://profile-avatar.csdnimg.cn/893e1f38fb454a229b6b224ff3d7e015_fanyi10.jpg!1",
"email": "fanyi10@gitcode.net"
},
"project": {
"id": 401539,
"name": "demo",
"description": "",
"web_url": "https://gitcode.net/fanyi10/demo",
"avatar_url": null,
"git_ssh_url": "git@gitcode.net:fanyi10/demo.git",
"git_http_url": "https://gitcode.net/fanyi10/demo.git",
"namespace": "凡衣",
"visibility_level": 0,
"path_with_namespace": "fanyi10/demo",
"default_branch": "master",
"ci_config_path": ".codechina-ci.yml",
"homepage": "https://gitcode.net/fanyi10/demo",
"url": "git@gitcode.net:fanyi10/demo.git",
"ssh_url": "git@gitcode.net:fanyi10/demo.git",
"http_url": "https://gitcode.net/fanyi10/demo.git"
},
"object_attributes": {
"assignee_id": null,
"author_id": 2670498,
"created_at": "2023-10-08 16:13:11 +0800",
"description": "",
"head_pipeline_id": null,
"id": 76421,
"iid": 1,
"last_edited_at": null,
"last_edited_by_id": null,
"merge_commit_sha": null,
"merge_error": null,
"merge_params": {
"force_remove_source_branch": "1"
},
"merge_status": "unchecked",
"merge_user_id": null,
"merge_when_pipeline_succeeds": false,
"milestone_id": null,
"source_branch": "fanyi10-master-patch-79959",
"source_project_id": 401539,
"state_id": 1,
"target_branch": "master",
"target_project_id": 401539,
"time_estimate": 0,
"title": "更新111",
"updated_at": "2023-10-08 16:13:11 +0800",
"updated_by_id": null,
"url": "https://gitcode.net/fanyi10/demo/-/merge_requests/1",
"source": {
"id": 401539,
"name": "demo",
"description": "",
"web_url": "https://gitcode.net/fanyi10/demo",
"avatar_url": null,
"git_ssh_url": "git@gitcode.net:fanyi10/demo.git",
"git_http_url": "https://gitcode.net/fanyi10/demo.git",
"namespace": "凡衣",
"visibility_level": 0,
"path_with_namespace": "fanyi10/demo",
"default_branch": "master",
"ci_config_path": ".codechina-ci.yml",
"homepage": "https://gitcode.net/fanyi10/demo",
"url": "git@gitcode.net:fanyi10/demo.git",
"ssh_url": "git@gitcode.net:fanyi10/demo.git",
"http_url": "https://gitcode.net/fanyi10/demo.git"
},
"target": {
"id": 401539,
"name": "demo",
"description": "",
"web_url": "https://gitcode.net/fanyi10/demo",
"avatar_url": null,
"git_ssh_url": "git@gitcode.net:fanyi10/demo.git",
"git_http_url": "https://gitcode.net/fanyi10/demo.git",
"namespace": "凡衣",
"visibility_level": 0,
"path_with_namespace": "fanyi10/demo",
"default_branch": "master",
"ci_config_path": ".codechina-ci.yml",
"homepage": "https://gitcode.net/fanyi10/demo",
"url": "git@gitcode.net:fanyi10/demo.git",
"ssh_url": "git@gitcode.net:fanyi10/demo.git",
"http_url": "https://gitcode.net/fanyi10/demo.git"
},
"last_commit": {
"id": "f975869aef715011f9313e861889e110947464c3",
"message": "更新111",
"title": "更新111",
"timestamp": "2023-10-08T16:13:01+08:00",
"url": "https://gitcode.net/fanyi10/demo/-/commit/f975869aef715011f9313e861889e110947464c3",
"author": {
"name": "凡衣",
"email": "fanyi10@gitcode.net"
}
},
"work_in_progress": false,
"total_time_spent": 0,
"human_total_time_spent": null,
"human_time_estimate": null,
"assignee_ids": [

],
"state": "opened",
"action": "open"

},
"labels": [

],
"changes": {
"author_id": {
"previous": null,
"current": 2670498
},
"created_at": {
"previous": null,
"current": "2023-10-08 16:13:11 +0800"
},
"description": {
"previous": null,
"current": ""
},
"id": {
"previous": null,
"current": 76421
},
"iid": {
"previous": null,
"current": 1
},
"merge_params": {
"previous": {
},
"current": {
"force_remove_source_branch": "1"
}
},
"source_branch": {
"previous": null,
"current": "fanyi10-master-patch-79959"
},
"source_project_id": {
"previous": null,
"current": 401539
},
"target_branch": {
"previous": null,
"current": "master"
},
"target_project_id": {
"previous": null,
"current": 401539
},
"title": {
"previous": null,
"current": "更新111"
},
"updated_at": {
"previous": null,
"current": "2023-10-08 16:13:11 +0800"
}
},
"repository": {
"name": "demo",
"url": "git@gitcode.net:fanyi10/demo.git",
"description": "",
"homepage": "https://gitcode.net/fanyi10/demo"
}
}

展开
收起
三分钟热度的鱼 2023-10-10 15:50:05 152 0
2 条回答
写回答
取消 提交回答
  • 面对过去,不要迷离;面对未来,不必彷徨;活在今天,你只要把自己完全展示给别人看。

    在云效中,您可以通过代码提交、Tag 创建、合并请求等代码仓库事件触发流水线运行。如果您的代码合并事件被设置为触发流水线运行,那么当您合并代码时,流水线就会自动运行。请注意,如果您希望在合并代码时触发流水线运行,您需要确保您的代码合并事件已经被设置为触发流水线运行。

    2023-10-10 23:06:34
    赞同 展开评论 打赏
  • 5fc31fa22cce31efef54f7f4221f74b3.png
    提交到test分支之后流水线触发:ed0d1cf70909f87c3acc963ddbc0fcd7.png
    之后将test分支合并到master 9d302476665443d774a3841afd59d58d.pnggitcode创建合并请求之后会触发两个merge request hook和一个push hook,是这个往master的push hook触发的流水线流水线只要接收到push的事件的webhook请求就会触发的所以唯一解决的方法是让gitcode执行合并请求的时候不要触发push events。
    此回答整理自钉群“云效API反馈(外部用户)”

    2023-10-10 16:13:13
    赞同 展开评论 打赏

云效,企业级一站式研发协同平台,数十万企业都在用。支持公共云、专有云和混合云多种部署形态,通过云原生新技术和研发新模式,助力创新创业和数字化转型企业快速实现研发敏捷和组织敏捷,打造“双敏”组织,实现多倍效能提升。

热门讨论

热门文章

相关电子书

更多
新一代高效Git协同模型 立即下载
AGit-Flow:新一代高效Git协同模型 立即下载
AGit-flow:新一代高效Git协同模型 立即下载