Skip to content

Commit 5240552

Browse files
committed
Only skip adding labels if they are type:: labels
Signed-off-by: Kyle Squizzato <[email protected]>
1 parent d1a9086 commit 5240552

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

.github/actions/pr-labels/src/index.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,13 @@ async function run() {
7171
).data.map((label) => label.name);
7272
core.debug(`Found ${labels.length} labels: ${labels.join(", ")}`);
7373

74-
// If labels already exist, skip adding new labels
75-
if (labels.length > 0) {
76-
core.info("Labels already exist on PR, skipping adding new labels");
74+
// Check if any type:: labels already exist
75+
const existingTypeLabels = labels.filter(label => label.startsWith("type::"));
76+
core.debug(`Found ${existingTypeLabels.length} type labels: ${existingTypeLabels.join(", ")}`);
77+
78+
// If type labels already exist, skip adding new labels
79+
if (existingTypeLabels.length > 0) {
80+
core.info("Type labels already exist on PR, skipping adding new labels");
7781
} else {
7882
// Get PR details to check for semantic commit messages
7983
await addSemanticLabels(octokit, labels);

0 commit comments

Comments
 (0)