Skip to content

setup notifications

Terminal window
holocron setup notifications [--scope <scope>] [--provider <name>] [--yes] [--dry-run]

Reads the layout a notifications provider declares in holocron.config.ts and creates whatever is missing: categories, channels (with their topics), a webhook per channel that asks for one, and roles. Every step looks things up by name first, so re-running it changes nothing that already exists, and --dry-run previews it. A step that fails is reported and the rest still run; the command exits non-zero if any did.

providers: {
notifications: [
"discord",
{
guildId: "1303969001822486568", // the server id; not a secret
layout: {
categories: [
{
name: "ALERTS",
channels: [
{ name: "alerts", topic: "Needs a human", webhook: true },
{ name: "errors" },
],
},
],
roles: [{ name: "gatekeepers", mentionable: true }],
},
},
],
}

A role can carry a secret too (roles: [{ name: "gatekeepers", mentionable: true, secret: "HOLOCRON_NOTIFY_ALERT_ROLE" }]): the command stores the role’s id there, so a workflow can ping the role without anyone copying the id by hand. The id is not sensitive; it is a secret only because the token that writes the webhook secrets can write it too.

A role can follow a GitHub team with team: "<slug>": holocron sync roles then gives it to every team member who has linked their account and takes it from linked people who have left. setup only creates the role; the membership is that command’s job.

A role can also declare how it looks and what it may do: color (#rrggbb), hoist (show its members as their own group in the member list) and permissions (the provider’s own names, for Discord ViewChannel, SendMessages and so on). The permission list is exact: a permission not named is not granted. Only what the layout states is compared and changed, and the bot can only grant permissions it holds itself.

A category or channel can declare who may see it and post in it with access:

categories: [
{ name: "ALERTS", access: { post: [] }, channels: [/* … */] }, // read-only: bots and webhooks post
{ name: "STAFF", access: { view: ["gatekeepers"] }, channels: [/* … */] }, // hidden from everyone but gatekeepers
];

view and post are each "everyone" (the default) or a list of role names from the layout’s roles. A channel takes its category’s access, and stating view or post on the channel replaces only that field. setup writes the permission overwrites explicitly, so the list is exact and replaces any set by hand; it also keeps the bot able to manage and post in a channel it has locked. The server itself is configured by a server section, applied last (it names channels, which exist by then):

server: {
verification: "medium", // none | low | medium | high | highest
defaultNotifications: "mentions", // all | mentions
contentFilter: "all", // off | noRoles | all
systemChannel: "welcome", // where the provider posts its own notices
rulesChannel: "rules",
updatesChannel: "community-updates",
community: true, // welcome screen, onboarding, discovery
description: "…",
locale: "en-US",
}

Each field you leave out is left alone, and the channels must be in the layout. community: true also needs both channels, a verification of at least low and contentFilter: "all", because Discord refuses to turn community features on otherwise. Changing the server needs the Manage Server permission, which Holonet does not have by default: setup then stops with an explanation and a link that re-invites the bot with exactly the permissions it needs (this updates its role in place, so Manage Server can be added without touching the server’s role list).

Turning community features on or off is the exception: Discord requires the Administrator permission for that, which is more than the bot should keep. setup therefore applies every other server setting first, in one request, and community in a second one. The updatesChannel goes in that second request when community is being turned on, because Discord refuses it on its own while community is off (it is accepted for any channel once community is on). If that second request is refused, the other settings stay applied and, with a terminal attached, setup walks you through it: it prints the link that gives Holonet Administrator, waits for you to approve it and press Enter, and retries; then it prints the link that takes Administrator away again, waits, and checks that Holonet no longer holds it (a permission still held is reported as a failure, so a forgotten step does not go unnoticed). The approval clicks stay yours, on Discord’s own authorization screen. Without a terminal (a script, CI) nothing waits: the message offers the same two ways forward, turn community on once in Discord (Server Settings → Enable Community; setup then leaves it alone), or give Holonet Administrator for one run with the link it prints and re-invite it with the normal link afterwards. A server the bot created itself needs none of this, because its owner can do everything. Turning community off works the same way, by hand under Server Settings → Community Settings → Disable Community, and setup does it before relaxing the settings Discord refuses to lower while community is on.

What a new member sees on joining is declared with welcome and onboarding, applied after the server settings (they need community features on):

welcome: {
description: "Where the Holocron is built…", // up to 140 characters
channels: [ // up to five, in order
{ channel: "rules", description: "How we treat each other", emoji: "📜" },
],
},
onboarding: {
defaultChannels: ["welcome", "rules", "dev"], // channels everyone starts with
prompts: [
{
title: "What brings you here?",
options: [
{ title: "Building with Holocron", emoji: "🛠️", channels: ["dev", "ideas"] },
{ title: "Following releases", channels: ["releases"], roles: ["gatekeepers"] },
],
},
],
// enabled: true, // see below
},

Messages that should stay at the top of a channel are declared with pinned, applied after the channels exist:

pinned: [
{ channel: "welcome", content: "Welcome to the Holocron. Start in #rules, then pick your roles." },
],

A message can take its text from a file in the repository instead, { channel: "rules", file: ".holocron/pinned/rules.md" } (the path is relative to the repository root, and content and file are exclusive). The file is the source of truth: setup reads it first, stops before it changes anything if it cannot be read, and replaces a pin that no longer says what the file says, a hand edit in Discord included. See Channel content from a file.

setup posts each message and pins it, without letting it mention anyone. A #name in the text that is one of the server’s channels becomes a clickable link to it; a name that matches no channel, or more than one, stays as written. The layout is the whole set of messages the bot has pinned in a channel it names: a pin that says exactly this is left alone, a pin the layout does not declare (or a second copy of one it does) is removed, and a copy left unpinned by an earlier run that errored is pinned instead of posted again. Old pins are removed only after the new one is pinned, except in a channel at Discord’s limit of 50 pins, where an obsolete one goes first to make room. Only messages the bot itself posted count, and only among the channel’s last hundred messages, so a pin that has scrolled further back than that is not found and would be posted again. Two runs at once can each post the same message; each run keeps the oldest and removes the rest. Pinning needs Pin Messages (Discord’s own permission; Manage Messages no longer covers it), which Holonet does not have by default. With a terminal attached, setup prints the link that adds it, waits for you to approve it and press Enter, and retries (this updates the bot’s role in place, and unlike Administrator the permission stays). Without a terminal it stops with the same link in the message. You can also turn it on by hand under Server Settings → Roles → Holonet → Pin Messages. If the role has it but the pin is still refused, a permission override on the channel is taking it away; setup says so, and the fix is to remove the override under Edit Channel → Permissions. The text can be up to 2000 characters, and the channel must be one in the layout. Works without community features.

Channels and roles are named as in the layout. setup changes only what differs and reports it (updated welcome screen: description, channels). Each part left out is left alone; a prompt list you do declare is exact, so a question not in it is removed. Onboarding is not switched on unless enabled: true is set: Discord only allows that with at least 7 default channels, 5 of them open for members to post in, and it answers with its own explanation when the server falls short.

For Discord, “can’t post” means the Send Messages permission only. Discord refuses a change to the thread permissions on an existing channel from a bot whose own role lacks them, and Holonet’s does, so members can still start threads in a read-only channel until the bot is granted Create Public Threads, Create Private Threads and Send Messages in Threads (for example by re-inviting it with those permissions). Channels that already deny them are read as the same access and left alone, and when setup has to change something else on such a channel it carries those denies over untouched.

A role that may post must also be in view when view is a list, or it could not see the channel; setup refuses a layout that says otherwise. A channel or category with no access anywhere is left alone.

Discord lets the server owner and anyone with the Administrator permission see and post everywhere, whatever the overwrites say, so “hidden from everyone but gatekeepers” means hidden from everyone who is not an administrator. Keep Administrator for the few people who need it. Roles are created first, since access names them; naming a role the layout does not declare is refused before anything is created.

readers: ["<owner>/<repo>", ...] names the repositories that can read the secrets this layout fills (see below). testChannel: "<channel>" names the channel set aside for test posts (it must declare a webhook): holocron doctor notifications leaves one 🧪 test: message there on a full run to prove delivery works.

webhook: true stores the URL in HOLOCRON_NOTIFY_WEBHOOK_<CHANNEL>; webhook: { name, secret } overrides the webhook name and the secret name.

webhook: { handOff: true } also hands the URL to a vault layer. A command that runs on a machine (not in a workflow) cannot read the organization secret, and Discord shows a webhook’s URL only to the bot that made it, so the person would have to fetch it with the bot’s token. With handOff, setup writes <SECRET>=<url> (the same name the secret has, HOLOCRON_NOTIFY_WEBHOOK_<CHANNEL> by default) to the private credentials file, .holocron/.private/.credentials, the way heartbeats do: mode 0600, never overwritten, refused unless git ignores the path, and offered for deletion once you have imported it into the layer’s 1Password Environment (Developer, View Environments, the layer’s Environment, Import .env file). The CLI cannot write to a vault, so the import is yours. The URL comes from the webhook made in this run or from one the bot made earlier (Discord lists the URL of the bot’s own webhooks); a webhook a person made has no readable URL, so that channel’s row fails and says there is nothing to hand off. The row webhook URLs for import names the secrets and never a value, and --dry-run makes no file. The command prints each role’s id, which is what a workflow needs to ping it.

If storing a webhook’s URL fails, the command deletes the webhook it made, so no webhook is left that can post to the channel while nobody holds its URL, and the failing row says so. When that delete fails too, the row names the webhook’s id (never its URL) so you can remove it by hand. A webhook that already existed is never deleted. --dry-run creates and deletes nothing.

A webhook’s picture comes from webhookAvatar on the layout (every webhook), or webhook: { avatar } (one). Either is a path to a PNG, JPEG or GIF, read relative to the repository root, or an https:// URL, or { url, image }: the url is tried first, and if it cannot be read the image, a file in the repo, is used (the same form a feed’s avatar takes). A { url, image } needs at least one of the two, the url must be https://, and the image must be a file path, not a URL or any other scheme: form such as data:; setup refuses a layout that breaks these before it creates anything. A URL is downloaded with care: it follows at most three redirects, each only to another https:// address that carries no credentials and is not a loopback, private or link-local host (localhost, 10.x, 169.254.169.254, …), and it stops reading the moment the body passes 8 MB, however the server declares its size. A name that resolves to a private address is not caught. WebP is refused, because providers do not take it; convert it first. A picture that cannot be read stops the run before anything is created. The picture is set on a webhook that has none, and an existing one is left alone: Discord stores a hash, not the image, so there is no way to tell whether the one it holds is the same. To change it, remove the picture in Discord and run setup again.

A channel is a text channel unless it says kind: "forum". A forum is a channel where every conversation is a post of its own, and a post can carry tags:

{
name: "ideas",
kind: "forum",
topic: "One post for each ADR and spec. Gatekeepers change a tag to change the status.", // the guidelines above the posts
tags: [
{ name: "draft", emoji: "✏️", moderated: true },
{ name: "proposed", emoji: "💬", moderated: true },
],
},
  • Tags. setup adds a tag the forum lacks and corrects the emoji or moderated of one that differs. It never removes a tag the layout does not list, because posts carry them. A moderated tag can be applied only by the bot and by members who can manage threads, so give a role that right (permissions: ["ManageThreads"]) to decide who may change a status. The bot needs Manage Threads itself, to apply the tag and to grant it; setup asks for it in the invite link when the layout has a forum. The bot’s own role is managed by its integration, so it cannot be edited under Server Settings → Roles: when Discord refuses a role’s permissions because the bot lacks one, setup prints the link that re-authorises the bot, which updates that role in place. A forum holds at most 20 tags of 20 characters.
  • No webhook, no feed. A plain webhook post cannot start a post, so a forum takes no webhook or feeds.monitoring / feeds.errors, and setup refuses a layout that gives it one. The one feed a forum takes is feeds.prs, the pull-request feed (one post per pull request, kept by Sentinel); it needs all eight state tags (draft, conflicts, failing, changes requested, ready, in review, merged, closed) and is refused on a text channel. The other is feeds.incidents (#2366), the status page incident feed: the status page’s name (as monitoring.statusPages declares it), or true when one page is declared, with the five state tags investigating, identified, monitoring, resolved and maintenance; a forum carries one feed, so it cannot also have feeds.prs. holocron doctor notifications adds incident-feed-forum, incident-feed-tags and incident-feed-bot rows for it. The bot sends every message in that forum with link previews turned off, so a pull request’s link does not expand into a card over its status. For the same reason a pinned message cannot name a forum: pin in a post. The server’s own channels (systemChannel, rulesChannel, updatesChannel) are text channels too. The welcome screen and onboarding can feature a forum. A forum’s autoArchiveMinutes (60, 1440, 4320 or 10080, Discord’s four values; 60 is the shortest) is its default idle time before a post is archived and leaves the list; setup sets it and changes nothing when it already matches, and doctor notifications reports a difference in the channels row. feeds: { prs: { retainDays: 30 } } names how many days after a pull request closes its post may be deleted (a positive whole number, off when absent); it is declared and checked only, and nothing deletes a post until holocron sync prs (#2853) is built. The pull-request tag waiting is now in review: setup makes the new tag and never deletes the old one, and doctor notifications lists a remaining waiting tag as information (pr-feed-retired-tag) so a person deletes it in Discord; an existing post is re-tagged on its next event.
  • Tag emoji. A tag’s emoji is a Unicode emoji or a server emoji written ":git_merge:". A server emoji needs a picture declared elsewhere in the layout (a reaction’s image or an emojis entry), and setup makes it before the channel, so the tag can use it; setup updates the tags of an existing forum in place, and the emoji row of doctor notifications expects these emoji too.
  • Reactions. defaultReaction is the one emoji Discord offers on every post, and starterReactions are more that the bot adds to the first message of each post sync specs makes (a reaction the bot cannot add is skipped; it needs Add Reactions). Each is a Unicode emoji, written as it is ("✅"), or one of the server’s own emoji with its name between colons (":git_merge:", a name of 2 to 32 letters, digits and underscores). A word with no colons (git_merge) is refused, since it would be sent to Discord as text.
  • Server emoji from files. The object form { emoji: ":git_merge:", image: ".holocron/media/emoji/git_merge.png" } also says where setup finds a picture to make the emoji from when the server has none. The file lives under .holocron/media/ (as the webhook avatar does), is judged by its first bytes, not its name, and must be a PNG, JPEG, GIF, WebP or AVIF of at most 256 KiB; setup stops before it writes anything when it is not. The emoji is made before the channels. setup leaves an emoji that exists alone unless its picture differs from the layout’s file (see “Changed emoji pictures” below), so a second run changes nothing, and --dry-run only previews. Making one needs the bot to hold Create Guild Expressions (shown in Discord as Create Expressions); the invite link asks for it only when a layout gives an emoji an image, and holocron doctor notifications reports it in the bot-permissions row with that link. One name takes one picture. An emoji no reaction names is declared in the layout’s emojis list, { emoji: ":git_commit:", image } each; setup makes the ones the server lacks with the rest, and doctor notifications expects every one on the server. This repo’s prs forum uses :git_pull_request: as its default reaction and 👍 👎 ❓ with :git_merge: and :git_branch: as starters, and emojis holds the rest of the Octicons (MIT) git-* set (git_branch_check, git_commit, git_compare, git_merge_queue, git_pull_request_closed, git_pull_request_draft, and the 16px-only git_pull_request_agent, git_draft_agent, git_closed_agent, git_merge_agent, git_merge_queue_agent, git_pull_request_locked, git_pull_request_unlisted): sixteen server emoji in all, made from the pictures in .holocron/media/emoji/, whose LICENSE is the notice the license requires. Each is 128×128, transparent and coloured with Primer’s dark-theme colours (green for a pull request or a check, red for a closed one, purple for a merge, yellow for the merge queue, grey for the rest), made from the SVGs in .holocron/media/emoji/svg/ by node .holocron/media/emoji/make-emoji.mjs (it needs rsvg-convert; the colour table is at the top of the script). setup replaces an emoji that exists only when its picture differs from the file, so to change a colour run the script and run setup again (it asks first). Discord limits the emoji a server can hold (50 of each kind without boosts, from a third-party source), so sixteen leaves room for about 34 more; add icons sparingly.
  • Doctor. holocron doctor notifications has an emoji row: each server emoji a reaction names must be on the server, and a missing one fails by name (:git_merge: is not on the server), saying whether setup will make it from its image or it has to be added in the server’s settings. The channels row names a default reaction that differs (default reaction is "🔀" but the layout says ":git_merge:"). A server whose emoji cannot be read is a skipped row, not a pass.
  • A text channel cannot become a forum, or the reverse, and setup never deletes. If a channel of the other kind already has the name, setup stops with exists as a text channel, and Discord cannot turn it into a forum. Delete it in Discord (its messages go with it), then run setup again. holocron doctor notifications reports the same mismatch.

A service that has its own alerting can post into a channel directly, without a workflow in between. Declare it on the channel:

{ name: "uptime", webhook: true, feeds: { monitoring: true } }

setup gives the channel a dedicated webhook for that service (named after the provider, Checkly here, or whatever feeds.monitoring.webhook says, with the picture feeds.monitoring.avatar names (a file path or https:// URL, or { url, image }: the url is tried first, and if it cannot be read the image, a file in the repo, is used), or else the monitoring provider’s own icon (Checkly carries its own: its CDN first, then an embedded copy, so nothing needs configuring), or else the layout’s webhookAvatar; a picture is set only on a webhook that has none, so to change it, delete the webhook and run setup again) and hands its URL straight to the monitoring provider as an alert channel named Message to #uptime (or feeds.monitoring.name). The URL is shown once, so it is never stored in a secret: only the service that needs it has it, and deleting that webhook revokes that service alone and leaves every other webhook untouched.

With Checkly, the alert channel is a webhook formatted for Discord, sending failures, recoveries and degraded notices, and it is subscribed to every check on the account, unless a check names the alert channels it alerts through (alertChannels on the check in the monitoring provider’s config), in which case it is subscribed to the checks that name it and those that name none. Checks made through an API are never subscribed on their own, so a check added later is picked up by the next setup run. Checkly already labels a channel with its type (“Discord …”), which is why the default name is Message to #uptime and does not repeat it. An alert channel with the same name that already exists is adopted and brought in line (a new URL, the missing subscriptions, and the shipped message template, which is put back if it was edited) and keeps its own send settings, except the ones feeds.monitoring.alerts states; nothing is duplicated.

feeds.monitoring.alerts sets what the channel alerts about: { failure?, recovery?, degraded?, sslExpiry?, sslExpiryThreshold? }. A new channel starts with failure, recovery and degraded on and sslExpiry off; a setting left out of alerts is left alone on an existing channel, and one given is put back if it differs. setup stops, before anything is created, when a check’s alertChannels names an alert channel that no feeds.monitoring declares (including when the layout has no monitoring feed at all). When a channel has to be replaced, the settings you did not state go back as Checkly has them right before the update, and a subscription Checkly will not take back fails setup; one added in the instant between that read and the update cannot be kept. It adds subscriptions but never removes one: a check routed away from a channel it was already on stays subscribed until you unsubscribe it in Checkly, and doctor notifications names it.

To see a failing check reach the channel (done once for #uptime, 2026-10-27): make a throwaway API check that must fail, such as https://example.com asserting status 418, running every 5 minutes; run setup so it is subscribed; wait for the failure embed (title <check> has failed, linked to the run, with the status code, response time, location and tags); change the assertion to 200 and wait for <check> has recovered; delete the check and run setup again, which leaves the channel and the other subscriptions alone.

A channel named differently (for example Discord #uptime from an earlier version) is not found by name. Rename it in Checkly to the new default name before running setup; otherwise setup makes a second channel for the same webhook and both alert, or, if the webhook’s URL cannot be read back, fails because it can neither find a channel to update nor create one. Once renamed, do not run setup from an older release: it looks for the old name and will not find the renamed channel.

If the dedicated webhook already exists, its URL cannot be read back, so an existing alert channel keeps the URL it has and only its subscriptions are reconciled. Creating an alert channel that does not exist yet needs a fresh webhook: delete the old webhook in Discord and run setup again.

This needs a monitoring provider that manages alert channels (["checkly", { accountId }]). The checks themselves are declared wherever the service they watch lives; the feed only needs the provider. A --dry-run previews the webhook and alert channel and calls nothing.

An error tracker’s alerts reach a channel through the Comlink relay Worker (apps/comlink), because the tracker’s own Discord integration may sit behind a paid plan. Declare the channel and where the Worker answers:

layout: {
relay: { host: "comlink.theholocron.dev", errors: { projects: ["holocron-cli"] } },
categories: [{ name: "ALERTS", channels: [{ name: "errors", feeds: { errors: true } }] }],
}

Build the Worker first (pnpm --filter @theholocron/comlink run build). setup then makes a dedicated webhook for the channel (named after the errors provider, Sentry here, or feeds.errors.webhook; the picture is feeds.errors.avatar, else the layout’s webhookAvatar), points relay.host at the Worker with a proxied DNS record, and deploys the Worker with the webhook’s URL as its COMLINK_<SOURCE>_WEBHOOK secret and a route for the hostname. The URL goes to the Worker and nowhere else: it is not printed, reported or stored as a secret. Secrets set another way, such as the tracker’s signing secret COMLINK_<SOURCE>_SECRET, are kept when the Worker is deployed again.

With relay.errors, setup also does the tracker’s side. For Sentry it makes a custom integration (relay.errors.integration, default Comlink) whose webhook is the Worker’s URL, installs it, and makes an alert rule (relay.errors.rule, default Errors to Discord (Comlink), every relay.errors.projects project, at most one notice per issue every relay.errors.frequency minutes, default 5) that sends to it. When Sentry gives the integration’s signing secret (it may show it only when the integration is made), setup hands it to the Worker as COMLINK_<SOURCE>_SECRET in the same deploy and prints nothing. When it does not, the Worker keeps the secret it has and setup says so; copy the secret from the integration’s page into the prod layer’s 1Password Environment and run holocron sync secrets --env prod --cwd apps/comlink --worker comlink. An integration or rule that exists is adopted, not duplicated: its webhook, alert action, project list and enabled state are put right and everything else a person set is kept. Sentry does not let a call delete an integration, so setup never does. It needs a Sentry token of its own, sentry.comlink (see Tokens); the general Sentry token is the last resort.

Needs an errors provider (only for feeds.errors), a workers and a dns provider. The relay posts to one channel, so only one channel may have feeds.errors. relay.zone (default: the dns provider finds the zone of that hostname itself, so it is rarely needed), relay.script (default comlink) and relay.code (default apps/comlink/dist/worker.js) override the defaults. A --dry-run previews all of it and calls nothing. If the webhook already exists but was made by a person, its URL cannot be read back: delete it and run setup again.

A service other than the error tracker is declared under relay.sources, keyed by the source’s id (the path the relay serves it at, lower-case letters and digits, vercel), and carried by a channel with feeds.relay.<id>:

layout: {
relay: {
host: "comlink.theholocron.dev",
sources: { vercel: { capability: "deployment", events: ["deployment.error"], scope: ["prj_abc"] } },
},
categories: [{ name: "ALERTS", channels: [{ name: "deploys", feeds: { relay: { vercel: true } } }] }],
}

capability names the provider that makes the vendor’s webhook (deployment, dns, vault, auth, workers or source, which is the GitHub plugin and takes scope as one owner/name repository or options.org); its plugin implements the optional ensureRelaySource. provider (optional) names that plugin, the word providers.<capability> takes (vercel), for a capability the root config gives to another plugin: deployment holds one provider, so a repo that deploys with Cloudflare and has one Vercel app could not otherwise relay Vercel’s webhooks. It must be a plugin name (lower-case letters, digits and hyphens); the layout check refuses anything else. setup loads the named plugin beside the configured ones, with the options of the first holocron.config that names it (this config’s own entry, else a workspace package’s, such as apps/sentinel for vercel), and leaves the root’s own providers alone. Before it writes anything it refuses, naming the plugin, when no config names it, it does not resolve, it fails to build, it does not implement the capability or ensureRelaySource, or it has no token (checked with one read of the vendor, not on --dry-run, which loads the plugin and asks it nothing). name (default the id, capitalised), events, scope and options are handed to it as they are written, in the vendor’s own terms. setup asks the provider to make the webhook for https://<relay.host>/<id> (found again by that URL, so a second run changes nothing and nothing is deleted), makes the channel’s dedicated webhook (feeds.relay.<id>.webhook, default the id capitalised, and avatar as for the other feeds), and deploys the Worker once with COMLINK_<ID>_WEBHOOK and, when the provider made or chose a secret, COMLINK_<ID>_SECRET. Neither value is printed, reported or stored anywhere else. A vendor that lets the caller choose the secret is given a fresh one to use only when it makes the webhook; a webhook that already exists keeps its secret, which cannot be read back, and the Worker keeps the one it has. A step the vendor’s API cannot do is reported as a failure that names it, and the Worker is still deployed. One source feeds one channel, and a forum takes no relay feed.

Option Default Description
--scope <scope> the org Webhook secret scope: repo, env=<name>, or org=<name>
--provider <name> — Which notifications provider, when more than one can provision
--yes false Replace emoji whose picture changed without asking (without a terminal, required when one is)
--dry-run false Print what would happen without calling the provider

When the server already has an emoji the layout gives an image, setup compares the two and makes the emoji again only if the picture differs; a matching emoji is left alone, so a second run changes nothing. There is no option to pass.

  • How it compares. Discord returns no hash of an emoji’s picture, so the Discord plugin reads the emoji’s public copy from Discord’s CDN (cdn.discordapp.com/emojis/<id>.png), decodes it and the layout’s PNG and compares the pixels with a small tolerance, which absorbs Discord re-encoding the upload. A recolour or a different shape is a difference; a few pixels of noise is not. The layout’s image must be a PNG to be compared.
  • Fail safe. If the layout’s image is not a PNG, the CDN does not answer or a picture cannot be decoded, the emoji is left alone and the row says picture not compared: <reason>. It is never taken for a changed one.
  • Order. The images are read and checked first (PNG, JPEG, GIF, WebP or AVIF, at most 256 KiB); if any is unusable the run stops with nothing written. For each emoji to replace the Discord plugin makes the new one under a temporary name (<name>_new), deletes the old one, then renames the new one, so a failure never leaves the server without the emoji. If the old one cannot be deleted the new one is removed again and nothing changes; if only the rename fails, the error names the emoji left as :<name>_new:. A leftover <name>_new from an earlier failed run stops that replace until it is deleted or renamed.
  • Ids. A new emoji has a new id. The emoji are made before the channels, and a forum’s default reaction and starter reactions are looked up by name when the channel step runs, so the forum is set to the new id in the same run.
  • Reactions are lost. Deleting an emoji removes the reactions made with it from existing posts.
  • Asks first, only when needed. When at least one emoji will be replaced, setup names them and warns about the reactions, and asks unless --yes is given; without a terminal and without --yes it refuses, but only when a replace is pending. --dry-run lists each as would replace emoji :name: and writes nothing.
  • Permissions. Making the new emoji needs Create Guild Expressions. Deleting an emoji the bot made itself needs the same; deleting one someone else made needs Manage Guild Expressions. The bot-permissions row of doctor notifications does not ask for it (whether an emoji is replaced depends on the server, not the layout), so if Discord refuses the delete the error carries an invite link that does.
  • Where webhook secrets live. By default each webhook URL (and each role id) is stored as an organization secret that only the repositories in the layout’s readers can read (visibility selected, #2131). A webhook URL lets anyone who can read it post to the channel, and most repositories of the organization are public, so the secrets are never readable by every repository. readers is a list of owner/repo of that organization; without it (or with an empty list) setup refuses to write an organization secret and names the field, before it creates anything. A secret that already exists with visibility all is narrowed on the next run, and --dry-run needs no readers. A reader outside the organization is refused. Use --scope repo (or env=<name>) to keep a webhook to one repo, which needs no readers. A leaked URL is revoked by deleting the webhook in the provider and re-running the command for a new one.
  • The bot token never goes to a custom hostname. The Discord plugin only sends it to the real Discord API. A baseUrl in the provider options affects posting, not provisioning, unless unsafeBotBaseUrl: true is also set (for tests that stub the API).
  • Collisions. Two channels or roles that would write the same secret (names are compared case-insensitively, as GitHub does; release-notes and release_notes normalise to the same default) are refused before anything is created; give one a distinct secret.
  • Write access is proven first. Before creating any webhook, the command writes a throwaway secret (HOLOCRON_NOTIFY_PREFLIGHT_<random>, a new name every run so it can never overwrite one you have) at the target scope and deletes it, so a token that can read but not write fails before a webhook exists, not after (a webhook’s URL is shown once). If the delete is refused, the run stops and names the secret to remove by hand. Names under HOLOCRON_NOTIFY_PREFLIGHT are reserved and refused in a layout.
  • Logs stay free of provider bodies. A failing step shows the provider’s response body in the terminal; the structured log records only the plain error.

Run holocron doctor notifications first: it reads the server and the secrets store and tells you, step by step, what matches the layout and what does not. It cannot prove that a message arrives, which is what the manual workflow below is for.

The check-notify task is a manual workflow (workflow_dispatch) that posts one labelled test message to every notification channel, using the real org secrets, and fails the job for any channel whose webhook is missing or refuses the post. A red job names the channel to fix, and one channel failing does not hide the others. The alerts message pings the role from HOLOCRON_NOTIFY_ALERT_ROLE when it is set. Run it from the Actions tab once the org’s theholocron/.github has the reusable workflow. Each channel names its own webhook secret (channels is a JSON array of { name, secret, mention }), so layouts with custom secret names are checked correctly, and a channel marked mention fails if the role id is missing or malformed. Whether Discord lets that role be mentioned is a server-side fact the workflow cannot see; holocron doctor notifications (#1098) checks it.

  • An existing role is brought into line. If a role already exists with a different mentionable, color, hoist or permissions, setup changes only the fields that differ and prints updated role … : colour, hoist. A role that already matches is left alone. Discord only lets a bot edit roles below its own highest role, so keep the bot’s role above the ones it manages.

application sets what the bot’s page in the developer portal says, and everyone changes what ordinary members may do. Both are applied last, with the server’s settings.

application: {
description: "…", // up to 400 characters
tags: ["automation", "github"], // up to 5, each up to 20 characters
install: { scopes: ["bot"], permissions: ["ViewChannel", "SendMessages"] },
termsUrl: "https://…",
privacyUrl: "https://…",
roleConnectionsUrl: "https://…",
intents: { members: true, messageContent: true }, // the Server Members and Message Content Intents, switched on from code
redirectUris: ["http://localhost:53682/callback"], // checked only: the API cannot set them
},
everyone: { deny: ["MentionEveryone"] }, // only the bits named change

intents.members switches the Server Members Intent on or off. It is the toggle the portal shows for an app Discord has not verified (GATEWAY_GUILD_MEMBERS_LIMITED), and it is what lets sync roles list who holds a role. intents.messageContent does the same for the Message Content Intent (GATEWAY_MESSAGE_CONTENT_LIMITED, bit 19): with it off the bot reads every message in the server with empty text, embeds and attachments, so sync releases cannot find its marker in an announced release and cleanup embeds cannot see an embed. Both intents live in the one flags field, so a run that changes one keeps the other and every other bit, and one request sets both. A verified app’s plain bit is Discord’s to change. redirectUris is the opposite case: Discord accepts a write to it and silently ignores it, so setup and the doctor only check that each one is registered, and say what to add under OAuth2 → Redirects in the developer portal. A missing one fails the run until it is added.

A field left out is left alone. After each write the plugin reads the application back and fails, naming the field, if Discord did not keep it, so a field the API silently ignores shows up as a failure and not a false success. everyone never replaces the whole permission set: it adds what allow names and removes what deny names, and refuses a permission that is in both.

install sets the default install link, and Discord only allows one on a public bot. On a private bot the write is refused (APPLICATION_INSTALL_NEEDS_PUBLIC_INTEGRATION) and setup says so; leave install out, and invite the bot with a link you build (setup prints one when a permission is missing). Turning on Public Bot lets anyone add the bot to their server, so it is not something setup does.

Some things stay in the developer portal because the API does not expose them: whether the bot is public, and the verification review.