Skip to content

Commit ba99bee

Browse files
authored
[context.js] Add events pull_request_target:edited|ready_for_review|converted_to_draft (#36610)
1 parent 643ec5e commit ba99bee

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

.github/workflows/src/context.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,10 @@ export async function extractInputs(github, context, core) {
4545
context.payload.action === "synchronize" ||
4646
context.payload.action === "reopened" ||
4747
context.payload.action === "labeled" ||
48-
context.payload.action === "unlabeled"))
48+
context.payload.action === "unlabeled" ||
49+
context.payload.action === "edited" ||
50+
context.payload.action === "ready_for_review" ||
51+
context.payload.action === "converted_to_draft"))
4952
) {
5053
// Most properties on payload should be the same for both pull_request and pull_request_target
5154

.github/workflows/test/context.test.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,15 @@ describe("extractInputs", () => {
8888
context.payload.action = "reopened";
8989
await expect(extractInputs(github, context, createMockCore())).resolves.toEqual(expected);
9090

91+
context.payload.action = "ready_for_review";
92+
await expect(extractInputs(github, context, createMockCore())).resolves.toEqual(expected);
93+
94+
context.payload.action = "edited";
95+
await expect(extractInputs(github, context, createMockCore())).resolves.toEqual(expected);
96+
97+
context.payload.action = "converted_to_draft";
98+
await expect(extractInputs(github, context, createMockCore())).resolves.toEqual(expected);
99+
91100
// Action not yet supported
92101
context.payload.action = "assigned";
93102
await expect(extractInputs(github, context, createMockCore())).rejects.toThrow();

0 commit comments

Comments
 (0)