feat(ci): name the publisher and author in publish notifications - #1107
Merged
Conversation
Track Publishes has always dispatched who published a resource, and the Slack step used only the path - so the message could not tell you that one person published another's work, which is the normal shape of things here: authors edit, a smaller set of people publish. The message now names both, crediting the author only when it differs from the publisher, and links the page rather than printing a bare URL. The author comes from the source bus version history (`doc-last-modified-by` on the newest version), which is the only place that distinction is recorded. Slack only notifies on the `<@U012AB3CD>` id form - a plain `@name` renders as text and pings nobody - so emails are resolved through users.lookupByEmail when SLACK_BOT_TOKEN is set. Without that secret the message still reads correctly with `@name` handles, it just does not notify. Same for the admin token: no token means no author credit, not a failed run. Two smaller fixes along the way. Anything that was not `.md` or `.json` matched neither step's endsWith condition and produced no message at all, so published images, PDFs and sitemaps vanished silently; every publish is announced now. And the `.md` strip was a global regex, which would have mangled a path like `/docs/using.md-files`. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Lars Trieloff <lars@trieloff.net>
aem-code-sync
Bot
temporarily deployed
to
improve-publish-notifications
September 4, 2026 08:43
Inactive
|
Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
|
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
The workspace links and notifies on the `@name` form already, so resolving emails to `<@U...>` ids bought nothing and cost a new SLACK_BOT_TOKEN secret plus a users.lookupByEmail call on every publish. Removed both. The message is unchanged apart from the mention form, and the module loses a third of its code along with its only Slack dependency. The AEM admin token stays - it is what finds the author, and it is a secret that already exists. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Lars Trieloff <lars@trieloff.net>
aem-code-sync
Bot
temporarily deployed
to
improve-publish-notifications
September 4, 2026 09:01
Inactive
aem-code-sync
Bot
temporarily deployed
to
improve-publish-notifications
September 8, 2026 14:26
Inactive
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Track Publishes has always dispatched who published a resource. The Slack step used only the path, so the message could not tell you that one person published another's work — which is the normal shape of things here: authors edit, a smaller set of people publish.
Test Plan
Preview link (workflow-only change, no page affected): https://improve-publish-notifications--aem-website--adobe.aem.page/
After merge, the next publish posts to Slack. To see it sooner, publish any page and watch Actions → Log Publish.
Before and after
Today, for the real publish of
/docs/edge-delivery-service-configurationon 1 Sept:After:
That example is not invented — the version history shows
version-by: bohnert@adobe.comagainstdoc-last-modified-by: msagolj@adobe.comon that exact publish.The author is credited only when it differs from the publisher; one person doing both reads as noise. The author comes from the source bus version history (
doc-last-modified-byon the newest version), which is the only place that distinction is recorded — the publish log knows who pressed publish, not who wrote it.No new secrets
Handles are the email's local part —
msagolj@adobe.combecomes@msagolj, which this workspace links and notifies on.The only secret used is
AEM_LIVE_ADMIN_TOKEN, which already exists and is what finds the author. If that lookup fails the message still names the publisher, it just cannot credit an author — a failed lookup never costs you the notification.Two bugs fixed along the way
Silent drops. Both Slack steps were gated on
endsWith(path, '.md')or'.json'.ADD_MD_SUFFIXonly adds.mdto paths with no dot at all, so a published.png,.pdf,.svgor.xmlmatched neither condition and produced no message and no error. Every publish is announced now.A global regex where a suffix strip was meant.
replace-string-actionwith pattern\.mdremoves every occurrence, so/docs/using.md-files.mdwould have come out as/docs/using-files. There is a test for exactly that path.Verification
npm run lintandnpm testpass; 11 new tests cover path handling and every message shape..eslintrc.js, deliberately — feat: add YouTube chapter markers to community feed #880 adds anoverridesblock there and I did not want a conflict, so the script avoidsconsolerather than configuring around it.🤖 Generated with Claude Code