File tree Expand file tree Collapse file tree 2 files changed +16
-3
lines changed
Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -251,7 +251,6 @@ export const comment = async () => {
251251 CI_MERGE_REQUEST_TITLE ,
252252 GITLAB_COMMENT_TYPE ,
253253 GITLAB_COMMENT_DISCUSSION_AUTORESOLVE ,
254- GITLAB_COMMENT_DISCUSSION_AUTORESOLVE_ONLY_CHANGESET_EXISTS ,
255254 GITLAB_ADD_CHANGESET_MESSAGE ,
256255 } = env
257256
@@ -314,14 +313,26 @@ export const comment = async () => {
314313 switch ( GITLAB_COMMENT_TYPE ) {
315314 case 'discussion' : {
316315 if ( noteInfo ) {
316+ if (
317+ GITLAB_COMMENT_DISCUSSION_AUTORESOLVE === 'always' ||
318+ ( GITLAB_COMMENT_DISCUSSION_AUTORESOLVE === 'hasChangeset' &&
319+ hasChangeset )
320+ ) {
321+ await api . MergeRequestDiscussions . resolve (
322+ context . projectId ,
323+ mrIid ,
324+ noteInfo . discussionId ,
325+ true ,
326+ )
327+ }
328+
317329 return api . MergeRequestDiscussions . editNote (
318330 context . projectId ,
319331 mrIid ,
320332 noteInfo . discussionId ,
321333 noteInfo . noteId ,
322334 {
323335 body : prComment ,
324- resolved : GITLAB_COMMENT_DISCUSSION_AUTORESOLVE === 'always' || ( GITLAB_COMMENT_DISCUSSION_AUTORESOLVE === 'hasChangeset' && hasChangeset ) ,
325336 } ,
326337 )
327338 }
Original file line number Diff line number Diff line change @@ -20,7 +20,9 @@ export type Env = GitLabCIPredefinedVariables &
2020 GITLAB_CI_USER_NAME ?: string
2121 GITLAB_CI_USER_EMAIL : string
2222 GITLAB_COMMENT_TYPE : LooseString < 'discussion' | 'note' >
23- GITLAB_COMMENT_DISCUSSION_AUTORESOLVE : LooseString < 'always' | 'hasChangeset' >
23+ GITLAB_COMMENT_DISCUSSION_AUTORESOLVE : LooseString <
24+ 'always' | 'hasChangeset'
25+ >
2426 GITLAB_ADD_CHANGESET_MESSAGE ?: string
2527 DEBUG_GITLAB_CREDENTIAL : LooseString < '1' | 'true' >
2628
You can’t perform that action at this time.
0 commit comments