@@ -5,7 +5,7 @@ import type {
55 VersionType ,
66} from '@changesets/types'
77import type { Gitlab } from '@gitbeaker/core'
8- import type { MergeRequestDiffSchema } from '@gitbeaker/rest'
8+ import type { MergeRequestChangesSchema } from '@gitbeaker/rest'
99import { captureException } from '@sentry/node'
1010import { humanId } from 'human-id'
1111import { markdownTable } from 'markdown-table'
@@ -132,10 +132,10 @@ const getNoteInfo = (api: Gitlab, mrIid: number | string) =>
132132 )
133133
134134const hasChangesetBeenAdded = async (
135- allDiffsPromise : Promise < MergeRequestDiffSchema [ ] > ,
135+ changedFilesPromise : Promise < MergeRequestChangesSchema > ,
136136) => {
137- const allDiffs = await allDiffsPromise
138- return allDiffs . some ( file => {
137+ const changedFiles = await changedFilesPromise
138+ return changedFiles . changes . some ( file => {
139139 return (
140140 file . new_file &&
141141 / ^ \. c h a n g e s e t \/ .+ \. m d $ / . test ( file . new_path ) &&
@@ -169,14 +169,19 @@ export const comment = async () => {
169169 let errFromFetchingChangedFiles = ''
170170 try {
171171 const latestCommitSha = CI_MERGE_REQUEST_SOURCE_BRANCH_SHA
172- const allDiffsPromise = api . MergeRequests . allDiffs ( context . projectId , mrIid )
172+ const changedFilesPromise = api . MergeRequests . showChanges (
173+ context . projectId ,
174+ mrIid ,
175+ )
173176
174177 const [ noteInfo , hasChangeset , { changedPackages, releasePlan } ] =
175178 await Promise . all ( [
176179 getNoteInfo ( api , mrIid ) ,
177- hasChangesetBeenAdded ( allDiffsPromise ) ,
180+ hasChangesetBeenAdded ( changedFilesPromise ) ,
178181 getChangedPackages ( {
179- changedFiles : allDiffsPromise . then ( x => x . map ( x => x . new_path ) ) ,
182+ changedFiles : changedFilesPromise . then ( x =>
183+ x . changes . map ( x => x . new_path ) ,
184+ ) ,
180185 api,
181186 } ) . catch ( ( err : unknown ) => {
182187 if ( err instanceof ValidationError ) {
0 commit comments