Skip to content

chore(deps): bump google.golang.org/grpc from 1.80.0 to 1.82.1 in /control-plane in the go_modules group across 1 directory #1451

chore(deps): bump google.golang.org/grpc from 1.80.0 to 1.82.1 in /control-plane in the go_modules group across 1 directory

chore(deps): bump google.golang.org/grpc from 1.80.0 to 1.82.1 in /control-plane in the go_modules group across 1 directory #1451

name: Issue Assignment Tracking
# Tracks issue assignments in real-time and clears reminder labels when activity happens
on:
issues:
types: [assigned, unassigned]
issue_comment:
types: [created]
pull_request:
types: [opened, edited]
permissions:
issues: write
pull-requests: read
jobs:
# Handle new assignments
on-assignment:
if: github.event_name == 'issues' && github.event.action == 'assigned'
runs-on: ubuntu-latest
steps:
- name: Welcome new assignee
uses: actions/github-script@v7
with:
script: |
const issue = context.payload.issue;
const assignee = context.payload.assignee;
console.log(`Issue #${issue.number} assigned to ${assignee.login}`);
// Check if this is the first assignment (no previous reminder labels)
const labels = issue.labels.map(l => l.name);
const hasReminderLabels = labels.some(l =>
['reminder-sent', 'needs-update'].includes(l)
);
// Remove 'help wanted' label if present
if (labels.includes('help wanted')) {
await github.rest.issues.removeLabel({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue.number,
name: 'help wanted'
}).catch(() => {});
}
// Only welcome if this is a fresh assignment (no previous reminders)
if (!hasReminderLabels) {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue.number,
body: `Thanks for picking this up, @${assignee.login}! :tada:\n\n**Here's what to expect:**\n- We'll check in after **7 days** if we haven't heard an update\n- After **14 days**, we'll send a second reminder\n- After **21 days** without activity, we'll unassign to let others contribute\n\n**Tips for success:**\n- Drop a comment when you start working on it\n- Share any blockers - we're here to help!\n- Link your PR with \`Fixes #${issue.number}\` in the description\n\nHappy coding! :rocket:`
});
}
# Clear reminder labels when assignee comments
on-assignee-comment:
if: github.event_name == 'issue_comment'
runs-on: ubuntu-latest
steps:
- name: Clear reminder labels on assignee activity
uses: actions/github-script@v7
with:
script: |
const issue = context.payload.issue;
const comment = context.payload.comment;
const commenter = comment.user.login;
// Skip if this is a PR comment
if (issue.pull_request) return;
// Check if commenter is an assignee
const assignees = issue.assignees.map(a => a.login);
if (!assignees.includes(commenter)) {
console.log(`Commenter ${commenter} is not an assignee, skipping`);
return;
}
console.log(`Assignee ${commenter} commented on #${issue.number}`);
const labels = issue.labels.map(l => l.name);
const reminderLabels = ['reminder-sent', 'needs-update'].filter(l => labels.includes(l));
if (reminderLabels.length === 0) {
console.log('No reminder labels to clear');
return;
}
// Clear reminder labels
for (const label of reminderLabels) {
await github.rest.issues.removeLabel({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue.number,
name: label
}).catch(() => {});
}
console.log(`Cleared labels: ${reminderLabels.join(', ')}`);
# Handle unassignment
on-unassignment:
if: github.event_name == 'issues' && github.event.action == 'unassigned'
runs-on: ubuntu-latest
steps:
- name: Handle unassignment
uses: actions/github-script@v7
with:
script: |
const issue = context.payload.issue;
const unassignee = context.payload.assignee;
console.log(`${unassignee.login} unassigned from #${issue.number}`);
// If no assignees left, add 'help wanted' label
if (issue.assignees.length === 0) {
const labels = issue.labels.map(l => l.name);
// Clear any reminder labels
for (const label of ['reminder-sent', 'needs-update']) {
if (labels.includes(label)) {
await github.rest.issues.removeLabel({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue.number,
name: label
}).catch(() => {});
}
}
// Add 'help wanted' if not already present
if (!labels.includes('help wanted')) {
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue.number,
labels: ['help wanted']
});
}
}
# Track PRs that link to issues
on-pr-link:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Clear reminders when PR is linked
uses: actions/github-script@v7
with:
script: |
const pr = context.payload.pull_request;
const prAuthor = pr.user.login;
const text = `${pr.title} ${pr.body || ''}`;
// Find linked issues
const issueMatches = text.match(/(close[sd]?|fix(e[sd])?|resolve[sd]?)[\s:]*#(\d+)/gi) || [];
const issueNumbers = [...new Set(
issueMatches.map(m => {
const num = m.match(/#(\d+)/);
return num ? parseInt(num[1]) : null;
}).filter(Boolean)
)];
if (issueNumbers.length === 0) {
console.log('No linked issues found in PR');
return;
}
console.log(`PR #${pr.number} links to issues: ${issueNumbers.join(', ')}`);
for (const issueNumber of issueNumbers) {
try {
const issue = await github.rest.issues.get({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issueNumber
});
// Check if PR author is an assignee
const assignees = issue.data.assignees.map(a => a.login);
if (!assignees.includes(prAuthor)) {
console.log(`PR author ${prAuthor} is not assigned to #${issueNumber}`);
continue;
}
const labels = issue.data.labels.map(l => l.name);
const reminderLabels = ['reminder-sent', 'needs-update'].filter(l => labels.includes(l));
// Clear reminder labels
for (const label of reminderLabels) {
await github.rest.issues.removeLabel({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issueNumber,
name: label
}).catch(() => {});
}
if (reminderLabels.length > 0) {
console.log(`Cleared labels on #${issueNumber}: ${reminderLabels.join(', ')}`);
}
} catch (err) {
console.log(`Error processing issue #${issueNumber}: ${err.message}`);
}
}