Skip to content

feat: allow to filter by label#38

Open
FezVrasta wants to merge 1 commit intojuliangruber:masterfrom
FezVrasta:patch-1
Open

feat: allow to filter by label#38
FezVrasta wants to merge 1 commit intojuliangruber:masterfrom
FezVrasta:patch-1

Conversation

@FezVrasta
Copy link

No description provided.

Copy link
Owner

@juliangruber juliangruber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

? res.data.length &&
res.data
.filter((pr) => pr.user.login === author)
.filter((pr) => pr.labels.some((lb) => lb.name === label))[0]
Copy link
Owner

@juliangruber juliangruber Dec 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't find anything if the PR has no labels:

> [].some(() => true)
false

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say that's correct?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But doesn't this mean that this action won't be able to find PRs without labels any more?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see what you mean, that's right.

Honestly I switched to actions/github-script as they allow to easily define custom logic so I'm not sure if this action would require additional features implemented. If anyone needs smth more complex they can use actions/github-script

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants