Skip to content

Commit 170cf56

Browse files
jamietannaClaude Sonnet 4.6
andauthored
ci(auto-label): manually comment + close issues (#42722)
As GitHub Actions adding the label doesn't then trigger dessant/label-actions, we need to manually handle it. Co-authored-by: Claude Sonnet 4.6 <jamie.tanna+claude-code@mend.io>
1 parent be2eacd commit 170cf56

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

.github/workflows/auto-label-needs-discussion.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,24 @@ jobs:
4444
labels: ['needs-discussion'],
4545
});
4646
core.info(`Added 'needs-discussion' label (author role: ${roleName})`);
47+
48+
// GitHub Actions adding the label won't trigger dessant/label-actions, so we need to do it manually
49+
await github.rest.issues.createComment({
50+
owner: context.repo.owner,
51+
repo: context.repo.repo,
52+
issue_number: context.payload.issue.number,
53+
body: `**Please create a GitHub Discussion instead of this issue.**\n\nIssues in this repository are for creation by Maintainers only - please create a GitHub Discussion instead.\nIf needed, a Renovate maintainer will create an Issue after your Discussion been triaged and confirmed.\n\nThis Issue will now be closed and locked. We may later batch-delete this issue. This way we keep Issues actionable, and free of duplicates or wrong bug reports.\n\nThanks, the Renovate team`,
54+
});
55+
56+
await github.rest.issues.update({
57+
owner: context.repo.owner,
58+
repo: context.repo.repo,
59+
issue_number: context.payload.issue.number,
60+
state: 'closed',
61+
state_reason: 'not_planned',
62+
});
63+
64+
core.info(`Commented and closed issue as not planned`);
4765
} else {
4866
core.info(`Skipping label — author has ${roleName} access`);
4967
}

0 commit comments

Comments
 (0)