Хочу написать скрипт на python, который удалит файл из удаленного репозитория gitlab (из определенной ветки).
Для начала решил ознакомиться с gitlab api. Есть документация
там есть пример для curl:
PAYLOAD=$(cat << 'JSON'
{
"branch": "master",
"commit_message": "some commit message",
"actions": [
{
"action": "create",
"file_path": "foo/bar",
"content": "some content"
},
{
"action": "delete",
"file_path": "foo/bar2"
},
{
"action": "move",
"file_path": "foo/bar3",
"previous_path": "foo/bar4",
"content": "some content"
},
{
"action": "update",
"file_path": "foo/bar5",
"content": "new content"
},
{
"action": "chmod",
"file_path": "foo/bar5",
"execute_filemode": true
}
]
}
JSON
)
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" --header "Content-Type: application/json" --data "$PAYLOAD"
Пытаюсь через curl выполнить
curl --request POST --header "PRIVATE-TOKEN: ***" --header "Content-Type: application/json" --data '{"branch":"my_branch","commit_message":"message","actions":[{"action":"delete","file_path":"README.md"}]}'
никакое сообщение с ошибкой не падает, но файл README.md не удаляется, проверял PRIVATE-TOKEN -указан верно, ветка my_branch существует,
id проекта bp url указан верно, почему не удаляется файл?
Commits API | GitLab
Documentation for GitLab Community Edition, GitLab Enterprise Edition, Omnibus GitLab, and GitLab Runner.
docs.gitlab.com