Skip to content

ci: bound Discord issue announcement formatting - #183

Merged
Daxiongmao87 merged 12 commits into
mainfrom
fix/discord-issue-markdown
Jul 19, 2026
Merged

ci: bound Discord issue announcement formatting#183
Daxiongmao87 merged 12 commits into
mainfrom
fix/discord-issue-markdown

Conversation

@Daxiongmao87

@Daxiongmao87 Daxiongmao87 commented Jul 17, 2026

Copy link
Copy Markdown
Owner

Summary

  • Move Discord payload construction out of the workflow's embedded jq parser and into a 250-line, dependency-free ES module.
  • Preserve paragraph and list boundaries, leading indentation, complete indented-code lines, and simple top-level backtick fences.
  • Convert ordinary ATX headings to Discord-safe bold labels while retaining explicit heading provenance; authored bold paragraphs and heading-like code indented by spaces, tabs, or spaced tabs remain unchanged.
  • Bound descriptions to 700 Unicode code points by retaining complete blocks; skip leading generated headings when applying the oversized-prose word fallback.
  • Bound titles to 256 Unicode code points without splitting astral characters.
  • Keep empty-body fallback, issue metadata, mention suppression, and webhook delivery behavior.

Deliberate scope boundary

This is a bounded announcement formatter, not a CommonMark/GFM parser. It does not parse or repair inline emphasis, inline-code delimiter runs, links, reference links, GFM tilde fences, or nested blockquote/list fence containers. Unsupported constructs remain ordinary normalized text. This removes the duplicated parser state machines that expanded the workflow to 1,431 lines.

Final maintainability limits:

44  .github/workflows/announce-new-issue.yml
250 .github/scripts/build-issue-announcement.mjs
270 tests/regression/announce-new-issue-payload.test.mjs

Related work

Empirical Verification (UTRs)

Focused payload regression

$ node --test tests/regression/announce-new-issue-payload.test.mjs
✔ issue 181 keeps readable complete sections within the Discord limit
✔ empty bodies retain fallback metadata and disable mentions
✔ line ending and prose normalization preserve paragraph boundaries
✔ lists retain line boundaries and leading indentation
✔ supported code blocks preserve whitespace and heading-like content
✔ unsupported tilde fences remain ordinary normalized text
✔ truncation keeps complete blocks and drops a dangling heading and fence
✔ word fallback skips generated headings and retains oversized prose
✔ truncation preserves authored standalone bold paragraphs
✔ an oversized first block truncates on a complete word
✔ description bounds count Unicode code points without splitting astral text
✔ bounded formatting leaves inline Markdown semantics untouched
✔ oversized titles retain the Discord title limit
✔ title bounds count Unicode code points without splitting astral text
✔ command line entry point writes the workflow payload
ℹ tests 15
ℹ pass 15
ℹ fail 0
ℹ duration_ms 107.635014

Workflow validation

$ go run github.com/rhysd/actionlint/cmd/actionlint@v1.7.12 .github/workflows/announce-new-issue.yml
Exit 0; no diagnostics.

Formatter lint

$ npx eslint --no-ignore .github/scripts/build-issue-announcement.mjs
Exit 0; no diagnostics.

Formatting

$ npx prettier --check .github/workflows/announce-new-issue.yml .github/scripts/build-issue-announcement.mjs tests/regression/announce-new-issue-payload.test.mjs tests/regression/fixtures/issue-181-body.md
Prettier: all files formatted

Generated payload smoke check

Description begins: "**Summary**\n\nAllow the primary Simulacrum agent to delegate multiple independent"
Description code points: 634
Ends with complete-block ellipsis: PASS
Supported backtick fences balanced: PASS
Emoji description code points: 700 WELL_FORMED
Emoji title code points: 256 WELL_FORMED
Leading-heading prose fallback: PASS
Indented trailing whitespace: PASS
Spaced-tab code: PASS
Mentions disabled: {"parse":[]}
Live Discord request: not sent
Generation time: 0.036s

Security invariants

  • Workflow permission is limited to contents: read for checkout.
  • Checkout uses persist-credentials: false.
  • Discord mentions remain disabled through allowed_mentions: { parse: [] }.
  • The webhook URL continues to come exclusively from DISCORD_ISSUE_WEBHOOK_URL.

@Daxiongmao87

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cfb2523979

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/announce-new-issue.yml Outdated
Comment thread .github/workflows/announce-new-issue.yml Outdated
Comment thread .github/workflows/announce-new-issue.yml Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d4a8ba4456

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/announce-new-issue.yml Outdated
Comment thread .github/workflows/announce-new-issue.yml Outdated
Comment thread .github/workflows/announce-new-issue.yml Outdated
Comment thread .github/workflows/announce-new-issue.yml Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 319284751c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/announce-new-issue.yml Outdated
Comment thread .github/workflows/announce-new-issue.yml Outdated
Comment thread .github/workflows/announce-new-issue.yml Outdated
Comment thread .github/workflows/announce-new-issue.yml Outdated
Comment thread .github/workflows/announce-new-issue.yml Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a335c004b0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/announce-new-issue.yml Outdated
Comment thread .github/workflows/announce-new-issue.yml Outdated
Comment thread .github/workflows/announce-new-issue.yml Outdated
Comment thread .github/workflows/announce-new-issue.yml Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2f94b8454a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/announce-new-issue.yml Outdated
Comment thread .github/workflows/announce-new-issue.yml Outdated
Comment thread .github/workflows/announce-new-issue.yml Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: faa0965e82

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/announce-new-issue.yml Outdated
Comment thread .github/workflows/announce-new-issue.yml Outdated
Comment thread .github/workflows/announce-new-issue.yml Outdated
Comment thread .github/workflows/announce-new-issue.yml Outdated
Comment thread .github/workflows/announce-new-issue.yml Outdated
Comment thread .github/workflows/announce-new-issue.yml Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d2c1936110

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/announce-new-issue.yml Outdated
Comment thread .github/workflows/announce-new-issue.yml Outdated
Comment thread .github/workflows/announce-new-issue.yml Outdated
Comment thread .github/workflows/announce-new-issue.yml Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b77a126686

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/announce-new-issue.yml Outdated
Comment thread .github/workflows/announce-new-issue.yml Outdated
Comment thread .github/workflows/announce-new-issue.yml Outdated
Comment thread .github/workflows/announce-new-issue.yml Outdated
@Daxiongmao87

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 63e61371c8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/announce-new-issue.yml Outdated
Comment thread .github/workflows/announce-new-issue.yml Outdated
Comment thread .github/workflows/announce-new-issue.yml Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: be31b925cf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/announce-new-issue.yml Outdated
Comment thread .github/workflows/announce-new-issue.yml Outdated
Comment thread .github/workflows/announce-new-issue.yml Outdated
Comment thread .github/workflows/announce-new-issue.yml Outdated
@Daxiongmao87 Daxiongmao87 changed the title ci: preserve Markdown in Discord issue announcements ci: bound Discord issue announcement formatting Jul 19, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7648f23c79

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/scripts/build-issue-announcement.mjs Outdated
@Daxiongmao87

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7648f23c79

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/scripts/build-issue-announcement.mjs Outdated
@Daxiongmao87
Daxiongmao87 force-pushed the fix/discord-issue-markdown branch from 7648f23 to 3294ebf Compare July 19, 2026 03:24
@Daxiongmao87

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3294ebfaab

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/scripts/build-issue-announcement.mjs Outdated
Comment thread .github/scripts/build-issue-announcement.mjs Outdated
@Daxiongmao87
Daxiongmao87 force-pushed the fix/discord-issue-markdown branch from 3294ebf to 411dff3 Compare July 19, 2026 03:34

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 411dff3236

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/scripts/build-issue-announcement.mjs
Comment thread .github/scripts/build-issue-announcement.mjs
Comment thread .github/scripts/build-issue-announcement.mjs
@Daxiongmao87
Daxiongmao87 force-pushed the fix/discord-issue-markdown branch from 411dff3 to cbb2031 Compare July 19, 2026 03:40

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cbb2031b4b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/scripts/build-issue-announcement.mjs Outdated
@Daxiongmao87
Daxiongmao87 force-pushed the fix/discord-issue-markdown branch from cbb2031 to 95c147f Compare July 19, 2026 03:48
@Daxiongmao87

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 95c147f36e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/scripts/build-issue-announcement.mjs Outdated
@Daxiongmao87
Daxiongmao87 force-pushed the fix/discord-issue-markdown branch from 95c147f to 61e5889 Compare July 19, 2026 03:55
@Daxiongmao87

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 61e5889171

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/scripts/build-issue-announcement.mjs
@Daxiongmao87
Daxiongmao87 force-pushed the fix/discord-issue-markdown branch from 61e5889 to 114a480 Compare July 19, 2026 04:05
@Daxiongmao87

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: 114a480ccd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Daxiongmao87
Daxiongmao87 merged commit e6c8ef4 into main Jul 19, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant