affaan-m/ECC · error
invalid discussion id
Error message
invalid discussion id
What it means
announcementKey validates its inputs to form a stable dedup key: the repository must match owner/repo (no whitespace) and the discussion id must be valid. A malformed repository or id was supplied from the environment.
Source
Thrown at scripts/discord/announcement-core.mjs:25
}
export function releaseMarker(tag) {
const normalized = String(tag || '').trim();
if (!normalized) throw new Error('release tag is required');
return `<!-- ecc-release:${normalized} -->`;
}
export function findReleaseDiscussion(discussions, marker) {
return discussions.find(item => (
item?.category?.name === 'Announcements'
&& typeof item.body === 'string'
&& item.body.includes(marker)
)) || null;
}
export function announcementKey({ repository, discussionId }) {
if (!/^[^/\s]+\/[^/\s]+$/.test(String(repository || ''))) throw new Error('invalid repository');
if (!/^[A-Za-z0-9_-]+$/.test(String(discussionId || ''))) throw new Error('invalid discussion id');
return `${repository}:discussion:${discussionId}`;
}
export function buildDiscordPayload({ title, body, url, key }) {
const discussionId = String(key).split(':').at(-1);
const footer = `ecc:${discussionId}`;
const description = String(body || '').trim().slice(0, DISCORD_DESCRIPTION_LIMIT);
const nonce = `ecc-${createHash('sha256').update(String(key)).digest('hex').slice(0, 16)}`;
return {
allowed_mentions: { parse: [] },
nonce,
enforce_nonce: true,
embeds: [{
title: String(title || 'ECC announcement').trim().slice(0, 256),
description,
url: String(url || ''),
footer: { text: footer },
}],View on GitHub (pinned to 06c5e118c4)
Solutions
- Correct the value to one of the accepted options listed in the error message.
Defensive patterns
Strategy: validation
When it happens
Trigger: Triggered when announcement-core.mjs rejects the current invocation: invalid discussion id
Common situations: Occurs while running scripts/discord/announcement-core.mjs with invalid arguments, missing flags, or a failing external dependency; the guard at scripts/discord/announcement-core.mjs:25 aborts the command with this message.
AI-assisted analysis of affaan-m/ECC@06c5e118c4 (2026-08-18).
Data as JSON: /api/errors/c5e920c41f91b470.
Report an issue: GitHub.