We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fbfd9d9 commit ccb5cd6Copy full SHA for ccb5cd6
src/Provider/GitLab/GitLabMRService.ts
@@ -10,6 +10,7 @@ import * as Resources from '@gitbeaker/core';
10
import { Gitlab } from '@gitbeaker/rest';
11
12
import { configs } from '../../Config';
13
+import { Log } from '../../Logger';
14
15
export class GitLabMRService implements IGitLabMRService {
16
private readonly projectId: number;
@@ -86,7 +87,12 @@ export class GitLabMRService implements IGitLabMRService {
86
87
);
88
const collected = versions.filter((v) => v.state === 'collected');
89
- if (collected.length === 0) throw new Error('No collected version in MR');
90
+ if (collected.length === 0) {
91
+ Log.warn(
92
+ 'No collected version in this MR, will use SHA from the latest commit instead.',
93
+ );
94
+ return versions[0];
95
+ }
96
97
return collected[0];
98
}
0 commit comments