@@ -73,6 +73,30 @@ public Branch createBranch(Integer projectId, String branchName, String ref) thr
73
73
return (response .readEntity (Branch .class ));
74
74
}
75
75
76
+ /**
77
+ * Creates a tag for the project. Support as of version 6.8.x
78
+ *
79
+ * POST /projects/:id/repository/tags
80
+ *
81
+ * @param projectId the project to create the branch for
82
+ * @param tagName the name of the tag to create
83
+ * @param ref Source to create the tag from, can be an existing branch, tag or commit SHA
84
+ * @param message (optional) - Creates annotated tag.
85
+ * @param release_description (optional) - Add release notes to the git tag and store it in the GitLab database.
86
+ * @return the tag info for the created tag
87
+ * @throws GitLabApiException
88
+ */
89
+ public Tag createTag (Integer projectId , String tagName , String ref , String message , String release_description ) throws GitLabApiException {
90
+
91
+ Form formData = new GitLabApiForm ()
92
+ .withParam ("tag_name" , tagName , true )
93
+ .withParam ("ref" , ref , true )
94
+ .withParam ("message" , message , false )
95
+ .withParam ("release_description" , release_description , false );
96
+ Response response = post (Response .Status .CREATED , formData .asMap (), "projects" , projectId , "repository" , "tags" );
97
+ return (response .readEntity (Tag .class ));
98
+ }
99
+
76
100
/**
77
101
* Delete a single project repository branch. This is an idempotent function,
78
102
* protecting an already protected repository branch will not produce an error.
0 commit comments