Skip to content

Commit fcfc7e8

Browse files
authored
fix(workflows): exempt catalog automation from PR-count confirmation (#4607)
Clarify that repository-owned community extension, preset, and bundle workflows bypass the ordinary contributor confirmation gate only after successful validation and allowed catalog/docs updates. Add regression coverage for the runtime-imported instruction, draft PR configuration, and catalog-specific allowed files. Fixes #4597 Co-authored-by: WOLIKIMCHENG <WOLIKIMCHENG@users.noreply.github.com>
1 parent a89c317 commit fcfc7e8

4 files changed

Lines changed: 29 additions & 1 deletion

File tree

‎.github/workflows/add-community-bundle.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,11 @@ repository README remains the source for the actual URLs.
276276

277277
Create one draft pull request.
278278

279+
This repository-owned gh-aw maintenance workflow does not perform the contributor
280+
open-PR count check or request confirmation. After successful validation and
281+
allowed catalog/docs file updates, emit the configured draft `create_pull_request`
282+
safe output regardless of the submitter's or filing account's open PR count.
283+
279284
- New entry branch:
280285
`community/${{ github.event.issue.number }}-add-<bundle-id>-bundle`
281286
- Update branch:

‎.github/workflows/add-community-extension.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,11 @@ Find the existing row and update any changed fields in-place.
257257

258258
Create a pull request with the changes. Use this branch naming convention:
259259

260+
This repository-owned gh-aw maintenance workflow does not perform the contributor
261+
open-PR count check or request confirmation. After successful validation and
262+
allowed catalog/docs file updates, emit the configured draft `create_pull_request`
263+
safe output regardless of the submitter's or filing account's open PR count.
264+
260265
- **New extension:** `add-<extension-id>-extension`
261266
- **Update:** `update-<extension-id>-extension`
262267

‎.github/workflows/add-community-preset.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,11 @@ Find the existing row and update any changed fields in-place.
310310

311311
Create a pull request with the changes. Use this branch naming convention:
312312

313+
This repository-owned gh-aw maintenance workflow does not perform the contributor
314+
open-PR count check or request confirmation. After successful validation and
315+
allowed catalog/docs file updates, emit the configured draft `create_pull_request`
316+
safe output regardless of the submitter's or filing account's open PR count.
317+
313318
- **New preset:** `add-<preset-id>-preset`
314319
- **Update:** `update-<preset-id>-preset`
315320

‎tests/test_github_workflows.py‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@
5656
"Do not modify any other files",
5757
),
5858
)
59+
REPOSITORY_OWNED_DRAFT_PR_EXEMPTION = (
60+
"This repository-owned gh-aw maintenance workflow does not perform the contributor "
61+
"open-PR count check or request confirmation. After successful validation and "
62+
"allowed catalog/docs file updates, emit the configured draft `create_pull_request` "
63+
"safe output regardless of the submitter's or filing account's open PR count."
64+
)
5965

6066

6167
def _publish_workflow_steps() -> dict[str, dict[str, object]]:
@@ -440,8 +446,15 @@ def test_community_upgrade_preserves_activation_and_permission_guards(kind):
440446
def test_community_upgrade_preserves_scoped_draft_pr_contract(
441447
kind, label, catalog_file, docs_file, instruction
442448
):
443-
source_text, _, source, compiled = _agentic_workflow(f"add-community-{kind}")
449+
source_text, compiled_text, source, compiled = _agentic_workflow(
450+
f"add-community-{kind}"
451+
)
444452
assert instruction in source_text
453+
assert REPOSITORY_OWNED_DRAFT_PR_EXEMPTION in " ".join(source_text.split())
454+
assert (
455+
f"{{{{#runtime-import .github/workflows/add-community-{kind}.md}}}}"
456+
in compiled_text
457+
)
445458
outputs = _safe_output_config(compiled)
446459
expected_outputs = {
447460
"add_comment", "add_labels", "create_pull_request", "noop",

0 commit comments

Comments
 (0)