Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions repo/baseline/seed/chezmoi/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ on:
push:
branches: [main]
pull_request:
merge_group:

permissions:
contents: read
Expand Down
1 change: 1 addition & 0 deletions repo/baseline/seed/docs/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ on:
push:
branches: [main]
pull_request:
merge_group:

permissions:
contents: read
Expand Down
1 change: 1 addition & 0 deletions repo/baseline/seed/go/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ on:
push:
branches: [main]
pull_request:
merge_group:

permissions:
contents: read
Expand Down
1 change: 1 addition & 0 deletions repo/baseline/seed/python/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ on:
push:
branches: [main]
pull_request:
merge_group:

permissions:
contents: read
Expand Down
14 changes: 14 additions & 0 deletions repo/baseline/test_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from pathlib import Path

import pytest
import yaml
from jsonschema import Draft202012Validator, ValidationError

from repo.baseline.check_manifest import check_manifest
Expand All @@ -16,6 +17,19 @@ def test_baseline() -> None:
check_manifest(ROOT)


@pytest.mark.parametrize("kind", ["chezmoi", "docs", "go", "python"])
def test_seed_ci_runs_on_merge_group(kind: str) -> None:
path = ROOT / "seed" / kind / ".github" / "workflows" / "ci.yml"
# Read the key before YAML can coerce `on` to a boolean.
workflow: object = yaml.compose(
path.read_text(encoding="utf-8"), Loader=yaml.SafeLoader
)
assert isinstance(workflow, yaml.MappingNode)
events = next(value for key, value in workflow.value if key.value == "on")
assert isinstance(events, yaml.MappingNode)
assert any(key.value == "merge_group" for key, _ in events.value)


@pytest.mark.parametrize(
"name", [".pre-commit-config.yaml", ".pre-commit-config.yml", "prek.toml"]
)
Expand Down
Loading