Skip to content

Commit 57181a0

Browse files
dgibbs64Copilot
andcommitted
feat(labeler): add confirmed Linux support label logic
* Introduced logic to determine and apply a `status: linux support confirmed` label based on AI assessment and Steam confirmation. * Implemented error handling for label creation if it does not exist. * Enhanced existing label management to ensure accurate representation of Linux support status. Co-authored-by: Copilot <copilot@github.com>
1 parent eac5084 commit 57181a0

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

‎.github/workflows/labeler.yml‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -996,6 +996,8 @@ jobs:
996996
const linuxYesFromAi =
997997
aiLinuxAssessment?.linux_support === 'yes' &&
998998
(aiLinuxAssessment?.confidence === 'high' || aiLinuxAssessment?.confidence === 'medium');
999+
const confirmedLinuxSupport =
1000+
confirmedLinuxFromSteam || confirmedLinuxFromSteamCmd || linuxYesFromAi;
9991001
// Soft positive: checkbox checked with no negative signals and no definitive Steam yes.
10001002
// Covers the common case of server-tool AppIDs where Steam API is inconclusive.
10011003
const likelySupportedByCheckbox =
@@ -1007,9 +1009,11 @@ jobs:
10071009
!linuxYesFromAi;
10081010
10091011
const NO_LINUX_LABEL = 'status: no linux support';
1012+
const CONFIRMED_LINUX_LABEL = 'status: linux support confirmed';
10101013
const LINUX_MARKER = '<!-- linux-support-check -->';
10111014
const steamDbLink = steamAppId ? `https://steamdb.info/app/${steamAppId}/` : null;
10121015
const shouldApplyNoLinuxLabel = confirmedNoLinux || suggestsNoLinux;
1016+
const shouldApplyConfirmedLinuxLabel = confirmedLinuxSupport && !confirmedNoLinux && !suggestsNoLinux;
10131017
10141018
if (shouldApplyNoLinuxLabel) {
10151019
// Auto-create the label if it does not exist yet.
@@ -1035,6 +1039,29 @@ jobs:
10351039
labelsToRemove.add(NO_LINUX_LABEL);
10361040
}
10371041
1042+
if (shouldApplyConfirmedLinuxLabel) {
1043+
try {
1044+
await github.rest.issues.getLabel({ owner, repo, name: CONFIRMED_LINUX_LABEL });
1045+
} catch (err) {
1046+
if (err.status === 404) {
1047+
try {
1048+
await github.rest.issues.createLabel({
1049+
owner,
1050+
repo,
1051+
name: CONFIRMED_LINUX_LABEL,
1052+
color: '0e8a16',
1053+
description: 'Game server has confirmed native Linux support',
1054+
});
1055+
} catch (createErr) {
1056+
console.log(`Could not create label "${CONFIRMED_LINUX_LABEL}": ${createErr.message}`);
1057+
}
1058+
}
1059+
}
1060+
labelsToAdd.add(CONFIRMED_LINUX_LABEL);
1061+
} else if (existingLabels.has(CONFIRMED_LINUX_LABEL)) {
1062+
labelsToRemove.add(CONFIRMED_LINUX_LABEL);
1063+
}
1064+
10381065
const reasons = [];
10391066
if (deterministicWindowsOnly) reasons.push('the provided docs/guides explicitly indicate Windows-only or no Linux support');
10401067
if (deterministicWineRequired && !hasLinuxEvidence) reasons.push('the provided docs/guides indicate a Wine/Proton requirement rather than native Linux binaries');

0 commit comments

Comments
 (0)