[PR #76] [MERGED] feat(stale): name the repo on every PR line in the Slack digest (BE-4574) #87

Closed
opened 2026-10-26 22:36:06 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Comfy-Org/github-workflows/pull/76
Author: @mattmillerai
Created: 7/26/2026
Status: ✅ Merged
Merged: 7/27/2026
Merged by: @mattmillerai

Base: main ← Head: matt/be-4574-stale-per-line-repo


📝 Commits (2)

  • 81d2894 feat(stale): name the repo on every PR line in the Slack digest (BE-4574)
  • 632d2f8 Merge remote-tracking branch 'origin/main' into matt/be-4574-stale-per-line-repo

📊 Changes

2 files changed (+21 additions, -15 deletions)

View changed files

📝 .github/workflows/stale.yml (+20 -14)
📝 README.md (+1 -1)

📄 Description

ELI-5

The Stale PR bot posts a Slack digest listing the PRs it just marked stale or closed. Each line only said #3523 — no repo. That reads fine when one repo is posting, but the same bot runs (and will increasingly run) in several repos into the same channel, so #3523 is ambiguous the moment a line is quoted, forwarded, or read on its own. This makes every line say Comfy-Org/cloud#3523 instead.

What changed

fmt() — the one line-builder used for BOTH the "Marked stale" and "Closed as stale" lists — now interpolates $REPO (github.repository, already in the step's env:) into the Slack link label:

before  • <https://github.com/Comfy-Org/cloud/pull/3523|#3523> ci(frontend-rotation): ...
after   • <https://github.com/Comfy-Org/cloud/pull/3523|Comfy-Org/cloud#3523> ci(frontend-rotation): ...

The header (*Stale PR bot — ${REPO}*) is unchanged and still names the repo — the per-line name is additive, not a replacement. Comments + the README catalog entry are updated to match.

BE-2776 built this reusable and deliberately scoped out per-line naming ("keep the per-PR link lines as-is — they already resolve correctly"). This is the follow-up that adds it.

Why it's safe

  • Format-only. No change to which PRs are staled/closed, to the actions/stale inputs, to the if: gating, or to the Slack POST/error handling.
  • The existing slack_escape on the title is untouched, and $REPO itself needs no escaping — GitHub constrains github.repository to [A-Za-z0-9._-]+/[A-Za-z0-9._-]+, which contains none of & < >.
  • The link target was already built from $REPO, so the label now simply matches the URL it points at.

Testing

  • Ran the exact new jq expression against a fixture matching actions/stale's output shape (a normal PR, a PR with a hostile title containing <!channel> / & / a masked <url|label> link, and a PR with no title key) plus the empty-string and [] inputs. Output:
    • <https://github.com/Comfy-Org/cloud/pull/3523|Comfy-Org/cloud#3523> ci(frontend-rotation): add optional minor bump via workflow_dispatch
    • <https://github.com/Comfy-Org/cloud/pull/158|Comfy-Org/cloud#158> evil &lt;!channel&gt; &amp; &lt;https://x|click&gt;
    • <https://github.com/Comfy-Org/cloud/pull/42|Comfy-Org/cloud#42>
    
    Escaping still holds; missing title still degrades to empty; empty/[] inputs still produce no lines.
  • actionlint .github/workflows/stale.yml — clean.
  • zizmor v1.22.0 --no-online-audits — no findings.
  • Not verified live: this reusable currently has no callers (both cloud and comfy-infra still run their own standalone copies), so no scheduled run exercises it yet. The companion PR below makes cloud the first caller.

Companion / merge order

Comfy-Org/cloud#5588 migrates cloud's standalone stale.yml to a thin caller of this reusable. Merge this PR first, then bump the SHA pin in that PR to the resulting main commit before merging it — otherwise cloud calls the pre-change reusable and the digest gets the repo name in the header only.

Follow-ups (not in this PR)

  • comfy-infra/.github/workflows/stale.yml is also still a standalone copy — same migration applies there; the ticket calls it out as a follow-up.
  • There is no bump-stale-callers.yml alongside the existing bump-*-callers.yml workflows, so caller SHA pins for this reusable have to be bumped by hand. Worth adding once it has real callers.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Comfy-Org/github-workflows/pull/76 **Author:** [@mattmillerai](https://github.com/mattmillerai) **Created:** 7/26/2026 **Status:** ✅ Merged **Merged:** 7/27/2026 **Merged by:** [@mattmillerai](https://github.com/mattmillerai) **Base:** `main` ← **Head:** `matt/be-4574-stale-per-line-repo` --- ### 📝 Commits (2) - [`81d2894`](https://github.com/Comfy-Org/github-workflows/commit/81d2894a3f5fea49e4bb6380df449c889f829f23) feat(stale): name the repo on every PR line in the Slack digest (BE-4574) - [`632d2f8`](https://github.com/Comfy-Org/github-workflows/commit/632d2f81dd6e6fdcfc5da39e35510daaf097c7da) Merge remote-tracking branch 'origin/main' into matt/be-4574-stale-per-line-repo ### 📊 Changes **2 files changed** (+21 additions, -15 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/stale.yml` (+20 -14) 📝 `README.md` (+1 -1) </details> ### 📄 Description ## ELI-5 The Stale PR bot posts a Slack digest listing the PRs it just marked stale or closed. Each line only said `#3523` — no repo. That reads fine when one repo is posting, but the same bot runs (and will increasingly run) in several repos into the same channel, so `#3523` is ambiguous the moment a line is quoted, forwarded, or read on its own. This makes every line say `Comfy-Org/cloud#3523` instead. ## What changed `fmt()` — the one line-builder used for BOTH the "Marked stale" and "Closed as stale" lists — now interpolates `$REPO` (`github.repository`, already in the step's `env:`) into the Slack link label: ``` before • <https://github.com/Comfy-Org/cloud/pull/3523|#3523> ci(frontend-rotation): ... after • <https://github.com/Comfy-Org/cloud/pull/3523|Comfy-Org/cloud#3523> ci(frontend-rotation): ... ``` The header (`*Stale PR bot — ${REPO}*`) is unchanged and still names the repo — the per-line name is additive, not a replacement. Comments + the README catalog entry are updated to match. BE-2776 built this reusable and deliberately scoped out per-line naming ("keep the per-PR link lines as-is — they already resolve correctly"). This is the follow-up that adds it. ## Why it's safe - Format-only. No change to which PRs are staled/closed, to the `actions/stale` inputs, to the `if:` gating, or to the Slack POST/error handling. - The existing `slack_escape` on the title is untouched, and `$REPO` itself needs no escaping — GitHub constrains `github.repository` to `[A-Za-z0-9._-]+/[A-Za-z0-9._-]+`, which contains none of `& < >`. - The link target was already built from `$REPO`, so the label now simply matches the URL it points at. ## Testing - Ran the exact new `jq` expression against a fixture matching `actions/stale`'s output shape (a normal PR, a PR with a hostile title containing `<!channel>` / `&` / a masked `<url|label>` link, and a PR with no `title` key) plus the empty-string and `[]` inputs. Output: ``` • <https://github.com/Comfy-Org/cloud/pull/3523|Comfy-Org/cloud#3523> ci(frontend-rotation): add optional minor bump via workflow_dispatch • <https://github.com/Comfy-Org/cloud/pull/158|Comfy-Org/cloud#158> evil &lt;!channel&gt; &amp; &lt;https://x|click&gt; • <https://github.com/Comfy-Org/cloud/pull/42|Comfy-Org/cloud#42> ``` Escaping still holds; missing title still degrades to empty; empty/`[]` inputs still produce no lines. - `actionlint .github/workflows/stale.yml` — clean. - `zizmor v1.22.0 --no-online-audits` — no findings. - Not verified live: this reusable currently has **no callers** (both `cloud` and `comfy-infra` still run their own standalone copies), so no scheduled run exercises it yet. The companion PR below makes `cloud` the first caller. ## Companion / merge order Comfy-Org/cloud#5588 migrates `cloud`'s standalone `stale.yml` to a thin caller of this reusable. **Merge this PR first**, then bump the SHA pin in that PR to the resulting `main` commit before merging it — otherwise `cloud` calls the pre-change reusable and the digest gets the repo name in the header only. ## Follow-ups (not in this PR) - `comfy-infra/.github/workflows/stale.yml` is also still a standalone copy — same migration applies there; the ticket calls it out as a follow-up. - There is no `bump-stale-callers.yml` alongside the existing `bump-*-callers.yml` workflows, so caller SHA pins for this reusable have to be bumped by hand. Worth adding once it has real callers. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-26 22:36:06 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Comfy-Org/github-workflows#87
No description provided.