Skip to content
Open
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
13 changes: 7 additions & 6 deletions .github/workflows/pr-classify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,11 @@ jobs:
const validPlatforms = ['web', 'android', 'ios', 'native'];

if (validTypes.includes(parsed.type)) {
typeLabel = `type: ${parsed.type}`;
typeLabel = parsed.type;
}
if (Array.isArray(parsed.platforms)) {
platformLabels = parsed.platforms
.filter(p => validPlatforms.includes(p))
.map(p => `platform: ${p}`);
.filter(p => validPlatforms.includes(p));
}
summary = parsed.summary || null;
}
Expand All @@ -108,10 +107,12 @@ jobs:
}
}

// --- Remove old type:/platform: labels ---
// --- Remove old type/platform labels ---
const validTypes = ['feature', 'fix', 'chore', 'refactor', 'language', 'documentation', 'test', 'security'];
const validPlatforms = ['web', 'android', 'ios', 'native'];
const existingLabels = await github.rest.issues.listLabelsOnIssue({ owner, repo, issue_number });
const toRemove = existingLabels.data
.filter(l => l.name.startsWith('type: ') || l.name.startsWith('platform: '))
.filter(l => validTypes.includes(l.name) || validPlatforms.includes(l.name))
.map(l => l.name);

for (const label of toRemove) {
Expand All @@ -132,7 +133,7 @@ jobs:
if (parseError || !typeLabel) {
await github.rest.issues.createComment({
owner, repo, issue_number,
body: `> [!WARNING]\n> **PR classification** could not determine the PR type. Please apply a \`type:\` label manually.`
body: `> [!WARNING]\n> **PR classification** could not determine the PR type. Please apply a type label manually.`
});
} else if (summary) {
const platformStr = platformLabels.length > 0
Expand Down
Loading