Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

Shared configuration for OpenArkStudio repositories.

- GitHub Actions results are summarized in Discord after each workflow completes.
- ARK and arknet summarize GitHub Actions results in Discord after each workflow completes.
- The Webhook is stored in the organization Actions secret `DISCORD_WEBHOOK_URL`.
- [Notification setup](docs/discord.md) | [中文说明](docs/discord_CN.md)
30 changes: 8 additions & 22 deletions docs/discord.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[English](discord.md) | [中文](discord_CN.md)

Each repository has `.github/workflows/notify-discord.yml`, which calls the shared
Only ARK and arknet have `.github/workflows/notify-discord.yml`, which calls the shared
`discord-summary.yml` workflow in this repository. It reads only the completed
workflow's metadata and job results. It does not execute the triggering commit or
download its artifacts. A matrix produces one summary per workflow attempt.
Expand All @@ -15,36 +15,22 @@ rate limits are retried twice; other delivery errors fail the notification job.
## Webhook configuration

The organization Actions secret `DISCORD_WEBHOOK_URL` has visibility set to all
repositories. GitHub Free does not provide organization secrets to private
repositories, so TARDIS also has a repository secret with the same name. To move
notifications to another Discord channel, replace the organization secret and
private repository copies. Repository or environment secrets with the same name
repositories. A Secret alone does not enable notifications; the caller workflow
must also exist. To move notifications to another Discord channel, replace the
organization secret. Repository or environment secrets with the same name
override the organization secret. Store the incoming Webhook URL without a
`/github` suffix. Never commit it.

## Workflow selection

The completion trigger names the source workflows explicitly. The installed
selection covers all existing OpenArkStudio workflows and common names for
repositories that do not yet have Actions. Add new workflow names to the
The completion trigger names the source workflows explicitly. Add new workflow names to the
`workflow_run.workflows` list when creating or renaming them. Keep
`Discord Notifications` out of that list to prevent notification recursion.
Adding this file does not enable existing disabled workflows or add build tests.

For new repositories, copy the notification file from an existing repository.
The organization secret is available to public repositories. Private repositories
on GitHub Free need a repository secret containing the same Webhook URL.

An organization administrator can also install or synchronize the notification
file across active repositories from this checkout:

```sh
node scripts/install-notifications.mjs
```

This requires Node.js and an authenticated GitHub CLI with repository and
`workflow` permissions. It updates only the notification file on each default
branch, skips archived repositories and verifies each uploaded file.
Other OpenArkStudio repositories do not install a caller. Enabling notifications
for another repository requires an explicit decision and a pull request adding
the caller. Keep changes to ARK and arknet's callers in their own pull requests.

## Resend a completed result

Expand Down
22 changes: 6 additions & 16 deletions docs/discord_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[English](discord.md) | [中文](discord_CN.md)

各仓库的 `.github/workflows/notify-discord.yml` 调用本仓库统一维护的
仅 ARK 与 arknet 的 `.github/workflows/notify-discord.yml` 调用本仓库统一维护的
`discord-summary.yml`。通知只读取已完成工作流的元数据和任务结果,
不执行触发通知的提交,也不下载其产物。矩阵任务按一次工作流执行汇总为一条消息。

Expand All @@ -13,29 +13,19 @@
## Webhook 配置

组织级 Actions Secret `DISCORD_WEBHOOK_URL` 的可见范围设为所有仓库。
GitHub Free 不向私有仓库提供组织 Secret,因此 TARDIS 另外配置了同名仓库 Secret。
切换 Discord 频道时,需要同时修改组织 Secret 和私有仓库中的副本。
Secret 本身不会启用通知,仓库还需要有通知入口工作流。
切换 Discord 频道时,修改组织 Secret。
仓库或环境中同名的 Secret 会覆盖组织配置。保存原始 Webhook URL,
不添加 `/github` 后缀,不将地址提交到仓库。

## 工作流选择

完成事件显式列出需要通知的工作流名称。已安装的列表覆盖 OpenArkStudio 现有工作流,
并为尚未使用 Actions 的仓库保留常用名称。新增或重命名工作流时,将名称加入
完成事件显式列出需要通知的工作流名称。新增或重命名工作流时,将名称加入
`workflow_run.workflows`。不要将 `Discord Notifications` 加入列表,避免通知递归。
添加通知文件不会启用已有的停用工作流,也不会增加构建测试。

新增仓库时,从已有仓库复制通知文件。公共仓库可以使用组织 Secret;
GitHub Free 下的私有仓库需要另外配置同名仓库 Secret,使用同一个 Webhook URL。

组织管理员也可以在本仓库中统一安装或同步各活跃仓库的通知文件:

```sh
node scripts/install-notifications.mjs
```

需要 Node.js,以及已登录并具备仓库和 `workflow` 权限的 GitHub CLI。
脚本只更新各仓库默认分支上的通知文件,跳过归档仓库,并验证每次写入的内容。
其他 OpenArkStudio 仓库不安装通知入口。需要为其他仓库开启通知时,先明确范围,
再通过 PR 添加入口文件。ARK 和 arknet 的通知配置也通过各自仓库的 PR 修改。

## 重新发送已完成结果

Expand Down
55 changes: 0 additions & 55 deletions scripts/install-notifications.mjs

This file was deleted.

Loading