Skip to content

Conversation

@claudiaregio
Copy link
Contributor

@claudiaregio claudiaregio commented Jul 25, 2025

When "prerelease" label is added, it should automatically add a comment to all those involved sharing how they can try the fix and link out to https://github.com/microsoft/vscode-dotnettools/wiki/Installing-and-updating-pre%E2%80%90release-versions-of-C%23-Dev-Kit-and-C%23-Extension.

When "fixed" label is added, it should automatically add a comment to all those involved just telling them to update to the latest versions of everything.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds automated GitHub workflow handling for "prerelease" and "fixed" labels on issues. When these labels are added, the workflows automatically comment on the issue to notify all involved participants with relevant instructions.

  • Adds prerelease label workflow that notifies participants about available pre-release fixes with documentation links
  • Adds fixed label workflow that notifies participants to update to latest versions
  • Both workflows gather all issue participants (author, commenters, reactors) for comprehensive notifications

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
.github/workflows/prerelease-label-comment.yml Workflow that triggers on "prerelease" label addition, gathers participants, and posts comment with pre-release installation instructions
.github/workflows/fixed-label-comment.yml Workflow that triggers on "fixed" label addition, gathers participants, and posts comment instructing to update to latest versions

with:
script: |
const mentions = '${{steps.participants.outputs.mentions}}';
const 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.`;
Copy link

Copilot AI Jul 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The participant gathering logic is duplicated between both workflows. Consider extracting this into a reusable action or composite action to reduce code duplication and improve maintainability.

Copilot uses AI. Check for mistakes.
Copy link
Member

@timheuer timheuer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't block this PR for sure, but the Copilot comment of using a composite script across both of these for the 'gather' is a fine one -- although would imagine we wouldn't get too out of sync.

i made a comment that some 'users' might be bots (our own labeler, etc.) so you may want to filter those known ones out.

mentions/reactions might be null (length=0) but I think you're likely still wanting to add a comment on the issue? if so, then you don't have to handle a null/0-len {mentions} as you aren't today.

commenters.forEach(u => all_reactors.delete(u));

// Combine all usernames
const all_users = [author, ...commenters, ...all_reactors];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you may get bots in gathering everyone and not want to mention them...

// Filter out bot users
const isBotUser = (username) => {
  return username.endsWith('[bot]') || 
         username.includes('bot') || 
         ['dependabot', 'renovate', 'greenkeeper', 'codecov', 'coveralls'].includes(username.toLowerCase());
};

// When building the all_users array:
const all_users = [author, ...commenters, ...all_reactors].filter(user => !isBotUser(user));


// Get all reactions from comments
let totalCommentReactions = 0;
for (const comment of comments) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Loop through comments once instead of twice but it doesn't really matter for github action.

@claudiaregio claudiaregio merged commit 5c287d3 into main Aug 5, 2025
1 check passed
@claudiaregio claudiaregio deleted the clregio/add-github-actions branch August 5, 2025 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants