Skip to content

Commit 5d6039f

Browse files
authored
[context.js] Log actual PRs if unexpected number (#36373)
1 parent 251ac2d commit 5d6039f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

.github/workflows/src/context.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// @ts-check
22

3+
import { inspect } from "util";
34
import { PER_PAGE_MAX } from "../../shared/src/github.js";
45
import { getIssueNumber } from "./issues.js";
56

@@ -170,7 +171,8 @@ export async function extractInputs(github, context, core) {
170171
issue_number = pullRequests[0].number;
171172
} else {
172173
throw new Error(
173-
`Unexpected number of pull requests associated with commit '${head_sha}'. Expected: '1'. Actual: '${pullRequests.length}'.`,
174+
`Unexpected number of pull requests associated with commit '${head_sha}'. ` +
175+
`Expected: '1'. Actual: '${pullRequests.length}'. PRs:\n${inspect(pullRequests)}`,
174176
);
175177
}
176178
if (!issue_number) {

0 commit comments

Comments
 (0)