Skip to content

Commit 9ac2ff9

Browse files
Check label history for opened pull requests
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 3415562 commit 9ac2ff9

1 file changed

Lines changed: 14 additions & 16 deletions

File tree

‎.github/workflows/label-external-contributions.yml‎

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -37,22 +37,20 @@ jobs:
3737
return;
3838
}
3939
40-
if (context.payload.action !== 'opened') {
41-
const events = await github.paginate(
42-
github.rest.issues.listEvents,
43-
{
44-
...context.repo,
45-
issue_number: pullRequest.number,
46-
per_page: 100,
47-
},
48-
);
49-
if (
50-
events.some(({ event, label: eventLabel }) =>
51-
event === 'unlabeled' && eventLabel?.name === label
52-
)
53-
) {
54-
return;
55-
}
40+
const events = await github.paginate(
41+
github.rest.issues.listEvents,
42+
{
43+
...context.repo,
44+
issue_number: pullRequest.number,
45+
per_page: 100,
46+
},
47+
);
48+
if (
49+
events.some(({ event, label: eventLabel }) =>
50+
event === 'unlabeled' && eventLabel?.name === label
51+
)
52+
) {
53+
return;
5654
}
5755
5856
await github.rest.issues.addLabels({

0 commit comments

Comments
 (0)