affaan-m/ECC · error

invalid repository

Error message

invalid repository

What it means

announcementKey validates the repository component of its id: it must match the 'owner/repo' shape (two non-empty, non-space segments). A malformed repository would corrupt the announcement receipt key.

Source

Thrown at scripts/discord/announcement-core.mjs:24

  return discussion?.category?.name === 'Announcements';
}

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

  1. 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 repository

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:24 aborts the command with this message.


AI-assisted analysis of affaan-m/ECC@06c5e118c4 (2026-08-18). Data as JSON: /api/errors/c22034f3008d23ea. Report an issue: GitHub.