zed/.github
John D. Swanson d344d7f1c5
Split size check into compute + label workflows for fork PR support (#51972)
## Context

Fork PRs receive a read-only `GITHUB_TOKEN`, causing 403 errors on all
label and comment writes
([example](https://github.com/zed-industries/zed/pull/51878)). This
splits the single workflow into two:

- **pr-size-check.yml** (`pull_request`): computes size and guided tour
detection, uploads a JSON artifact — read-only, works for forks
- **pr-size-label.yml** (`workflow_run`): downloads the artifact,
applies labels and comments — runs on the base repo with full write
access

### Security

- Artifact treated as untrusted data: fields are cast and validated
(`Number()`, `String()` + prefix check, `Boolean()`) before use
- No artifact content is executed or interpolated into shell
- Missing artifact handled gracefully (steps skip via output flag)

### Also included

- Structural guided tour detection: extracts "How to Review" section,
strips HTML comment placeholders, checks for actual author content
(fixes false positive in #51957)
- Softer confirmation: "appears to include guidance"

Tested locally end-to-end against 4 real PRs
(XL/small/medium/false-positive).

## How to Review

1. `pr-size-check.yml` — the compute half. Compare against the previous
version: all write operations removed, artifact upload added at the end.
2. `pr-size-label.yml` — new file. Download artifact, validate, apply
labels/comments. Same label logic as before, just in a `workflow_run`
context.

## Self-Review Checklist

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- N/A
2026-03-19 16:39:28 -04:00
..
actions ci: Fix docs build post #45130 (#45330) 2025-12-19 03:40:27 +00:00
DISCUSSION_TEMPLATE docs: Improve feature process (#51425) 2026-03-13 00:36:21 +03:00
ISSUE_TEMPLATE Remove deprecated Gemini 3 Pro Preview (#50503) 2026-03-04 15:53:26 +00:00
workflows Split size check into compute + label workflows for fork PR support (#51972) 2026-03-19 16:39:28 -04:00
actionlint.yml Reapply "Try namespace mac runners (#47675)" (#47721) (#47727) 2026-01-26 22:02:52 -07:00
cherry-pick-bot.yml Maybe make cherry-pick-bot better 2024-02-28 15:26:30 -07:00
CODEOWNERS.hold Remove Supermaven-related code from Zed (#50537) 2026-03-02 22:18:49 +00:00
FUNDING.yml Add sponsor button to main Zed repo (#46807) 2026-01-14 10:38:51 -06:00
pull_request_template.md Update assign-reviewers workflow for fork PR support (#51876) 2026-03-18 19:09:44 -04:00