diff --git a/.github/workflows/proto-version-check.yml b/.github/workflows/proto-version-check.yml index 41b8e8336..ea300419d 100644 --- a/.github/workflows/proto-version-check.yml +++ b/.github/workflows/proto-version-check.yml @@ -13,14 +13,23 @@ jobs: uses: actions/github-script@v7 with: script: | - const { data: files } = await github.rest.pulls.listFiles({ + const files = await github.paginate(github.rest.pulls.listFiles, { owner: context.repo.owner, repo: context.repo.repo, pull_number: context.issue.number, per_page: 100, }); - const pbFiles = files.filter(f => f.filename.endsWith('.pb.go') && f.patch); + const pbFiles = files.filter(f => f.filename.endsWith('.pb.go')); + const missingPatch = pbFiles.filter(f => !f.patch).map(f => f.filename); + if (missingPatch.length > 0) { + core.setFailed( + `Cannot inspect patch data for:\n` + + missingPatch.map(f => `- ${f}`).join('\n') + + `\nThis can happen with very large PRs. Verify proto versions manually.` + ); + return; + } const versionPattern = /^[+-]\s*\/\/\s+protoc(?:-gen-go)?\s+v[\d.]+/; const violations = [];