Skip to content

Commit f082d40

Browse files
authored
If possible, set assignee to the original PR's author (#13)
The calls are separated to allow the assignee call to fail and still let the milestone call to pass
1 parent 5afc246 commit f082d40

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

src/github.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,19 +112,30 @@ export const createBackportPr = async (
112112
},
113113
);
114114

115-
// set assignees and milestone
115+
// set milestone
116116
await fetch(
117117
`${GITHUB_API}/repos/go-gitea/gitea/issues/${json.number}`,
118118
{
119119
method: "PATCH",
120120
headers: HEADERS,
121121
body: JSON.stringify({
122-
// assignees: [originalPr.user.login],
123122
milestone: giteaVersion.milestoneNumber,
124123
}),
125124
},
126125
);
127126

127+
// set assignee
128+
await fetch(
129+
`${GITHUB_API}/repos/go-gitea/gitea/issues/${json.number}`,
130+
{
131+
method: "PATCH",
132+
headers: HEADERS,
133+
body: JSON.stringify({
134+
assignees: [originalPr.user.login],
135+
}),
136+
},
137+
);
138+
128139
// if the original PR had exactly one backport/* label, add the backport/done label to it
129140
const backportLabels = originalPr.labels
130141
.filter((label) => label.name.startsWith("backport/"));

0 commit comments

Comments
 (0)