Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strip label prefix in auto label workflow before performing GraphQL search query #6306

Merged
merged 1 commit into from
Jul 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/label-issue.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,16 @@ jobs:
}
}

// Strip the / prefix as it seems to break GraphQL searches
const sanitizedLabels = Array.from(labels).map(label => {
const parts = label.split('/');
return parts.length > 1 ? parts[1] : parts[0];
});

// Check to see if labels already exist, and if not, create them so we can set the color
const labelQuery = `{
repository(owner: "${context.repo.owner}", name: "${context.repo.repo}") {
labels(first: 50, query: "name: ${Array.from(labels).join(' || ')}") {
labels(first: 50, query: "name: ${sanitizedLabels.join(' || ')}") {
nodes {
name
}
Expand Down
Loading