我想自动化项目的构建和部署。在这方面,我想使用 Gitlab API 来重试 Gitlab Pipeline 中的特定作业。
我进行的 API 调用如下:
curl --request POST --header "PRIVATE-TOKEN: xxx" " https://gitlab.example.com/api/v4/projects/1/jobs/1/retry "
否则我的作业可以手动触发,我的 gitlab-ci.yml 文件如下所示:
execute_octoDeploy:
tags:
- windows
stage: build
when: manual
script:
- .\BuildScripts\octodeploy.ps1
我收到 403 错误,根据https://docs.gitlab.com/ee/api/README.html表示我没有被授权。而我拥有该项目的所有权利,并且我是该项目的所有者。
补充:我可以触发其他非手工作业,但不能触发这个。我还提到: https ://gitlab.com/gitlab-org/gitlab-ce/issues/22824
可能有什么问题?我该如何解决这个问题?