如何在GitLab上获取或创建标签?

问题描述

Gitlab版本:13.3.1

我使用c#库github并尝试创建标签:

var client =  new GitLabClient("https://gitlab.domain.local/","key");

        var projects = await client.Projects.GetAsync();
        var tagsProject=projects.FirstOrDefault(x=>x.Id ==25);
        //var tags = await client.Tags.GetAsync(tagsProject,"test");

        await client.Tags.CreateAsync(tagsProject,new GitLabApiClient.Models.Tags.Requests.CreateTagRequest("created test tag","master","message","release descriptions text")); //error

但是我有错误:

'<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
 <title>404 Not Found</title>
 </head><body>
 <h1>Not Found</h1>
 <p>The requested URL /api/v4/projects/user_name/tags-test-project/repository/tags was not found on this server.</p>
 </body></html>'

我做错了什么以及如何解决? 谢谢!

P.S。我尝试使用curl:

curl https://gitlab-ci-token:[email protected]/api/v4/projects/25/repository/tags

,它返回OK并显示标签。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)