Skip to content
Open
Show file tree
Hide file tree
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
14 changes: 7 additions & 7 deletions .github/workflows/release-comment-handler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
comment_on_label:
if: github.event.label.name == 'prerelease' || github.event.label.name == 'fixed'
if: github.event.label.name == 'prerelease' || github.event.label.name == 'stable'
runs-on: ubuntu-latest
permissions:
issues: write
Expand Down Expand Up @@ -148,14 +148,14 @@ jobs:
console.log("No participants to mention for prerelease. Skipping comment creation.");
return;
}
message = `${mentions}\n\nA fix for this issue is now available in the next pre-releases of C#DK/C#. If you'd like to try out the fix, please see [these instructions](https://github.com/microsoft/vscode-dotnettools/wiki/Installing-and-updating-pre%E2%80%90release-versions-of-C%23-Dev-Kit-and-C%23-Extension) to update or try pre-release versions.`;
message = `${mentions}\n\nA fix for this issue is now available in the **latest pre-release versions** of C# Dev Kit and the C# extension.\n\nTo help us validate the fix, please see [these instructions](https://github.com/microsoft/vscode-dotnettools/wiki/Installing-and-updating-pre%E2%80%90release-versions-of-C%23-Dev-Kit-and-C%23-Extension) to update or try pre-release versions.\n\nIssue resolved? ✅ Comment '*Status: Fixed*'\nIssue still occurring? ❌ Comment '*Status: Not Fixed*'`;
console.log("Generated prerelease message");
} else if (labelName === 'fixed') {
console.log("Processing fixed label");
} else if (labelName === 'stable') {
console.log("Processing stable label");
message = mentions.trim() !== ""
? `${mentions}\n\nThis issue has been fixed! Please update to the latest versions of VS Code, C# Dev Kit, and the C# extension.`
: `This issue has been fixed! Please update to the latest versions of VS Code, C# Dev Kit, and the C# extension.`;
console.log(`Generated fixed message ${mentions.trim() !== "" ? "with" : "without"} mentions`);
? `${mentions}\n\nThis issue has been fixed! Please update to the latest stable versions of VS Code, C# Dev Kit, and the C# extension.`
: `This issue has been fixed! Please update to the latest stable versions of VS Code, C# Dev Kit, and the C# extension.`;
console.log(`Generated stable message ${mentions.trim() !== "" ? "with" : "without"} mentions`);
}

console.log(`Final message length: ${message.length}`);
Expand Down
44 changes: 44 additions & 0 deletions .github/workflows/validation-status-comment-label-handler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Validation Status Comment Label Handler

on:
issue_comment:
types:
- created
- edited

permissions:
issues: write
contents: read

jobs:
add_status_label:
if: github.event.issue.pull_request == null
runs-on: ubuntu-latest
steps:
- name: Add validationstatus label based on comment text
uses: actions/github-script@v7
with:
script: |
const body = context.payload.comment?.body ?? '';
const normalized = body.trim().toLowerCase();

let labelToAdd = null;
if (/^status\s*:\s*fixed$/.test(normalized)) {
labelToAdd = 'fixed';
} else if (/^status\s*:\s*not\s+fixed$/.test(normalized)) {
labelToAdd = 'not-fixed';
}

if (!labelToAdd) {
console.log(`Comment did not match a status command: "${body}"`);
return;
}

const issueNumber = context.payload.issue.number;
await github.rest.issues.addLabels({
...context.repo,
issue_number: issueNumber,
labels: [labelToAdd],
});

console.log(`Added label "${labelToAdd}" to issue #${issueNumber}`);
Loading
Loading