Skip to content

Commit

Permalink
Use API to get labels instead of context
Browse files Browse the repository at this point in the history
Signed-off-by: Alejandro Hernández <[email protected]>
  • Loading branch information
alejandrohdezma authored and danielchabr committed Jul 31, 2021
1 parent 939a146 commit e1d7e79
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@ async function run() {

const failMessages = []

const prLabels = context.payload.pull_request.labels.map(item => item.name)
const { data: labelsOnIssue } = await octokit.issues.listLabelsOnIssue({
...context.repo,
issue_number: context.payload.pull_request.number
})

const prLabels = labelsOnIssue.map(item => item.name)

const hasSomeResult = !hasSomeInput || hasSomeLabels.some((label) =>
prLabels.includes(label)
Expand Down

0 comments on commit e1d7e79

Please sign in to comment.