Skip to content

Commit e1d7e79

Browse files
alejandrohdezmadanielchabr
authored andcommitted
Use API to get labels instead of context
Signed-off-by: Alejandro Hernández <[email protected]>
1 parent 939a146 commit e1d7e79

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,12 @@ async function run() {
2424

2525
const failMessages = []
2626

27-
const prLabels = context.payload.pull_request.labels.map(item => item.name)
27+
const { data: labelsOnIssue } = await octokit.issues.listLabelsOnIssue({
28+
...context.repo,
29+
issue_number: context.payload.pull_request.number
30+
})
31+
32+
const prLabels = labelsOnIssue.map(item => item.name)
2833

2934
const hasSomeResult = !hasSomeInput || hasSomeLabels.some((label) =>
3035
prLabels.includes(label)

0 commit comments

Comments
 (0)